### Question:
ConfigurationValueBoolean extends ConfigurationValue<Boolean, ConfigurationRequirementBoolean> { @Override public void triggerSetValue(Algorithm algorithm, Set<Class<?>> algorithmInterfaces) throws AlgorithmConfigurationException { if (!algorithmInterfaces.contains(BooleanParameterAlgorithm.class)) { throw new AlgorithmConfigurationException( "Algorithm does not accept boolean configuration values."); } BooleanParameterAlgorithm booleanParameterAlgorithm = (BooleanParameterAlgorithm) algorithm; booleanParameterAlgorithm.setBooleanConfigurationValue(this.identifier, this.values); } protected  ConfigurationValueBoolean();  ConfigurationValueBoolean(String identifier, Boolean... values);  ConfigurationValueBoolean(ConfigurationRequirementBoolean requirement); @Override void triggerSetValue(Algorithm algorithm, Set<Class<?>> algorithmInterfaces);  }### Answer:
@Test public void testTriggerSetValue() throws AlgorithmConfigurationException { BooleanParameterAlgorithm algorithm = mock(BooleanParameterAlgorithm.class); Set<Class<?>> interfaces = new HashSet<>(); interfaces.add(BooleanParameterAlgorithm.class); String expectedIdentifier = "configId1"; Boolean[] expectedConfigurationValue = {true, false}; ConfigurationValueBoolean configValue = new ConfigurationValueBoolean( new ConfigurationRequirementBoolean(expectedIdentifier).getIdentifier(), expectedConfigurationValue); configValue.triggerSetValue(algorithm, interfaces); verify(algorithm).setBooleanConfigurationValue(expectedIdentifier, expectedConfigurationValue); }
@Test public void testTriggerSetValueMissingInterface() { BooleanParameterAlgorithm algorithm = mock(BooleanParameterAlgorithm.class); Set<Class<?>> interfaces = new HashSet<>(); interfaces.add(AlgorithmType.TEMP_FILE.getAlgorithmClass()); String expectedIdentifier = "configId1"; Boolean[] expectedConfigurationValues = {true, false}; ConfigurationValueBoolean configValue = new ConfigurationValueBoolean( new ConfigurationRequirementBoolean(expectedIdentifier).getIdentifier(), expectedConfigurationValues); try { configValue.triggerSetValue(algorithm, interfaces); fail("No exception was thrown."); } catch (AlgorithmConfigurationException e) { } }