### Question:
ConfigurationValueDatabaseConnectionGenerator extends
  ConfigurationValue<DatabaseConnectionGenerator, ConfigurationRequirementDatabaseConnection> { @Override public void triggerSetValue(Algorithm algorithm, Set<Class<?>> algorithmInterfaces) throws AlgorithmConfigurationException { if (!algorithmInterfaces.contains(AlgorithmType.DB_CONNECTION.getAlgorithmClass())) { throw new AlgorithmConfigurationException( "Algorithm does not accept database connection input configuration values."); } DatabaseConnectionParameterAlgorithm databaseConnectionParameterAlgorithm = (DatabaseConnectionParameterAlgorithm) algorithm; databaseConnectionParameterAlgorithm.setDatabaseConnectionGeneratorConfigurationValue( this.identifier, this.values); } protected  ConfigurationValueDatabaseConnectionGenerator();  ConfigurationValueDatabaseConnectionGenerator(String identifier,
                                                       DatabaseConnectionGenerator... values);  ConfigurationValueDatabaseConnectionGenerator(
    ConfigurationRequirementDatabaseConnection requirement); @Override void triggerSetValue(Algorithm algorithm, Set<Class<?>> algorithmInterfaces);  }### Answer:
@Test public void testTriggerSetValue() throws AlgorithmConfigurationException { DatabaseConnectionParameterAlgorithm algorithm = mock(DatabaseConnectionParameterAlgorithm.class); Set<Class<?>> interfaces = new HashSet<>(); interfaces.add(AlgorithmType.DB_CONNECTION.getAlgorithmClass()); String expectedIdentifier = "configId1"; DatabaseConnectionGenerator[] expectedConfigurationValue = {mock(DatabaseConnectionGenerator.class), mock(DatabaseConnectionGenerator.class)}; ConfigurationValueDatabaseConnectionGenerator configValue = new ConfigurationValueDatabaseConnectionGenerator( new ConfigurationRequirementDatabaseConnection(expectedIdentifier).getIdentifier(), expectedConfigurationValue); configValue.triggerSetValue(algorithm, interfaces); verify(algorithm).setDatabaseConnectionGeneratorConfigurationValue(expectedIdentifier, expectedConfigurationValue); }
@Test public void testTriggerSetValueMissingInterface() { DatabaseConnectionParameterAlgorithm algorithm = mock(DatabaseConnectionParameterAlgorithm.class); Set<Class<?>> interfaces = new HashSet<>(); interfaces.add(AlgorithmType.TEMP_FILE.getAlgorithmClass()); String expectedIdentifier = "configId1"; DatabaseConnectionGenerator[] expectedConfigurationValues = {mock(DatabaseConnectionGenerator.class), mock(DatabaseConnectionGenerator.class)}; ConfigurationValueDatabaseConnectionGenerator configValue = new ConfigurationValueDatabaseConnectionGenerator( new ConfigurationRequirementDatabaseConnection(expectedIdentifier).getIdentifier(), expectedConfigurationValues); try { configValue.triggerSetValue(algorithm, interfaces); fail("No exception was thrown."); } catch (AlgorithmConfigurationException e) { } }