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