source: class HeadTableEngineTest extends AbstractTableEngine {
  
      private Connection connection;
  
      @Test
      public void execute_delete_deletesRecordsCorrectly() throws Exception {
  
target:         engine.create(testIndex);
  
          IndexCommit commit = mock(IndexCommit.class);
          when(commit.getTimestamp()).thenReturn(new Date(42));
  
          TestModel testModelA = new TestModel("A", 42);
          TestModel testModelB = new TestModel("B", -42);
  
          engine.execute(new InsertOperation(commit, testIndex, new ArrayList(Arrays.asList(testModelA, testModelB))));
  
          IndexCommit deleteCommit = mock(IndexCommit.class);
          when(deleteCommit.getTimestamp()).thenReturn(new Date(84));
  
          engine.execute(new DeleteOperation(deleteCommit, testIndex, new ArrayList(Arrays.asList(testModelB))));
  
          try (ResultSet rs = connection.createStatement().executeQuery("SELECT * FROM HEAD_TABLE")) {
              assertTrue(rs.next());
              assertEquals("A", rs.getString("TESTID"));
              assertEquals(42, rs.getInt("TESTINTEGER"));
              assertEquals(new Date(42), rs.getTimestamp("REV_CREATED"));
  
              assertFalse(rs.next());
          }
      }
  
  }