Simple python solution
\nclass Foo(object):\n    def __init__(self):\n        self.x = 0\n        \n    def first(self, printFirst):\n        printFirst()\n        self.x += 1\n\n    
```\nclass Foo(object):\n    def __init__(self):\n        self.x = 0\n        \n    def first(self, printFirst):\n        printFirst()\n        self.x += 1\n\n    def second(self, printSecond):\n        while self.x < 1:\n            pass\n        printSecond()\n        self.x += 1\n            \n    def third(self, printThird):\n        while self.x < 2:\n            pass\n        printThird()\n```
[]