@Test
public void testRemoveMultipleElementsFromHistory() throws Exception {

  MysqlSourceState firstState = mock(MysqlSourceState.class);
  MysqlSourceState secondState = mock(MysqlSourceState.class);
  MysqlSourceState thirdState = mock(MysqlSourceState.class);
  TestRepository repository = new TestRepository(firstState, secondState, thirdState);
  StateHistory<MysqlSourceState> history =
      new StateHistory<>(SOURCE_NAME, 3, repository, metrics);
  assertEquals(secondState, history.removeLast(2));
  assertEquals(Collections.singletonList(firstState), repository.get());
}