@Test(expected = IllegalStateException.class)
public void testRemoveMoreElementsThanInHistory() throws Exception {

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