### Question:
RepeatOperation extends Operation { public void setup( Operation operation, int desiredRepetitions ) { this.operation = Preconditions.checkNotNull(operation); this.desiredRepetitions = desiredRepetitions; }  void setup( Operation operation, int desiredRepetitions ); void setup( Operation operation ); @Override boolean process(float delta, Entity e); @Override void rewind(); @Override void reset(); int getRepetition(); static final int UNLIMITED; }### Answer:
@Test public void ensure_completes_when_invocations_reached() { operation = new RepeatOperation(); operation.setup(new TestOperation(2), 3); processOperation(6); assertTrue(operation.isCompleted()); }
@Test public void ensure_not_completed_when_invocations_not_reached() { operation = new RepeatOperation(); operation.setup(new TestOperation(2), 3); processOperation(5); assertTrue(!operation.isCompleted()); }
@Test public void ensure_unlimited_is_unlimited() { operation = new RepeatOperation(); this.operation.setup(new TestOperation(2)); processOperation(999); assertFalse(operation.isCompleted()); }