static void Main(string[] args) { Context context = new Context(new State1(new Context())); context.transition1(); context.transition2(); context.transition3(); context.transition1(); context.transition4(); context.transition2(); context.transition1(); }