Should throw illegal state exception if the method is called at the wrong time.