EVCacheProperties { protected Set<EVCacheConfiguration> toConfigurations() { return clusters.entrySet() .stream() .map(entry -> entry.getValue().toConfiguration(entry.getKey())) .collect(toSet()); } EVCacheProperties(@DefaultValue("true") final boolean enabled,
                             @DefaultValue("true") final boolean allowNullValues,
                             @NotEmpty @Valid final Map<String, Cluster> clusters); boolean isEnabled(); boolean isAllowNullValues(); Map<String, Cluster> getClusters();  }
@Test void should_be_converted_to_configurations() { final List<EVCacheConfiguration> configurations = new ArrayList<>(properties.toConfigurations()); assertThat(first(configurations).getProperties().getKeyPrefix()).isEmpty(); assertThat(first(configurations).getProperties().getTimeToLive()).isEqualTo(ofSeconds(1000)); assertThat(first(configurations).getProperties().getRetryEnabled()).isTrue(); assertThat(first(configurations).getProperties().getExceptionThrowingEnabled()).isTrue(); assertThat(second(configurations).getProperties().getKeyPrefix()).isEqualTo("test2"); assertThat(second(configurations).getProperties().getRetryEnabled()).isFalse(); assertThat(second(configurations).getProperties().getExceptionThrowingEnabled()).isFalse(); }