### Question:
BatchApiOperation implements ApiOperation, Iterable<ApiOperation> { @Override public boolean equals(Object o) { if (this == o) { return true; } if (!(o instanceof BatchApiOperation)) { return false; } BatchApiOperation other = (BatchApiOperation) o; return Iterators.elementsEqual(this.iterator(), other.iterator()); } BatchApiOperation(Iterator<ApiOperation> operations); @Override List<GenericJson> execute(IndexingService service); @Override List<GenericJson> execute(IndexingService service,
      Optional<Consumer<ApiOperation>> operationModifier); @Override Iterator<ApiOperation> iterator(); @Override boolean equals(Object o); @Override int hashCode();  }### Answer:
@Test public void testEquals() throws Exception { List<ApiOperation> list = ImmutableList.of(mockApiOperation); BatchApiOperation batch = new BatchApiOperation(list.iterator()); assertEquals(new BatchApiOperation(list.iterator()), batch); thrown.expect(IllegalStateException.class); batch.execute(null); }