### Question:
PayaraConfig implements Config { @Override public <T> Optional<T> getOptionalValue(String propertyName, Class<T> propertyType) { return Optional.ofNullable(getValueInternal(propertyName, propertyType)); } PayaraConfig(List<ConfigSource> configSources, Map<Class<?>,Converter<?>> converters);  PayaraConfig(List<ConfigSource> sources, Map<Class<?>,Converter<?>> converters, long ttl); @SuppressWarnings("unchecked") @Override T getValue(String propertyName, Class<T> propertyType); @Override Optional<T> getOptionalValue(String propertyName, Class<T> propertyType); @Override Iterable<String> getPropertyNames(); @Override Iterable<ConfigSource> getConfigSources(); Set<Class<?>> getConverterTypes(); @SuppressWarnings("unchecked") T getValue(String propertyName, String cacheKey, Long ttl, String defaultValue, Supplier<? extends Converter<T>> converter); @SuppressWarnings("unchecked") Converter<T> getConverter(Class<T> propertyType);  }### Answer:
@Test public void optionalBooleanArrayConversion() { assertArrayEquals(new Boolean[] { true, false, true }, config.getOptionalValue("bool2", Boolean[].class).get()); }
@Test public void undefinedPropertyReturnsEmptyOptional() { assertEquals(Optional.empty(), config.getOptionalValue("nonExisting", String.class)); }