### Question:
DatabaseSequenceMigrationExecutor extends DatabaseMigrationExecutor { private long getLastSequenceValue(String sequenceName) throws SQLException { return getSourceDatabaseQueryClient().getLastSequenceValue(sequenceName); }  @Override void executeMigrationInternal(String sequenceName);  }### Answer:
@Test void testExecuteMigrationInternalWhenLastSequenceValueIsZero() throws SQLException { Mockito.when(mockSourceDatabaseQueryClient.getLastSequenceValue(TEST_SEQUENCE_NAME)) .thenReturn(0L); Assertions.assertThrows(IllegalStateException.class, () -> databaseSequenceMigrationExecutor.executeMigration(TEST_SEQUENCE_NAME)); }
@Test void testExecuteMigrationInternalWhenLastSequenceValueIsNegative() throws SQLException { Mockito.when(mockSourceDatabaseQueryClient.getLastSequenceValue(TEST_SEQUENCE_NAME)) .thenReturn(-1L); Assertions.assertThrows(IllegalStateException.class, () -> databaseSequenceMigrationExecutor.executeMigration(TEST_SEQUENCE_NAME)); }
@Test void testExecuteMigrationInternalWhenLastSequenceValueIsPositive() throws SQLException { Mockito.when(mockSourceDatabaseQueryClient.getLastSequenceValue(TEST_SEQUENCE_NAME)) .thenReturn(1L); databaseSequenceMigrationExecutor.executeMigration(TEST_SEQUENCE_NAME); Mockito.verify(mockTargetDatabaseQueryClient) .updateSequence(TEST_SEQUENCE_NAME, 1L); }