CompositeOperation implements MongoDbOperation { @Override public void execute(final MongoDatabase connection, final Document data) { for (final MongoDbOperation operation : operations) { operation.execute(connection, data); } } CompositeOperation(final MongoDbOperation... operations); @Override void execute(final MongoDatabase connection, final Document data);  }
@Test public void testOperationExecution() { final CompositeOperation operation = new CompositeOperation(operation1, operation2, operation3); final Document data = new Document(); operation.execute(connection, data); final InOrder order = inOrder(operation1, operation2, operation3); order.verify(operation1).execute(eq(connection), eq(data)); order.verify(operation2).execute(eq(connection), eq(data)); order.verify(operation3).execute(eq(connection), eq(data)); }