EntityInfo { @JsonIgnore public List<T> getConfigurations() { return groups.stream() .map(EntityGroupInfo::getConfiguration) .collect(toList()); } EntityInfo();  EntityInfo(String id, List<EntityGroupInfo<T, R>> groups); String getId(); void setId(String id); List<EntityGroupInfo<T, R>> getGroups(); void setGroups(List<EntityGroupInfo<T, R>> groups); @JsonIgnore List<T> getConfigurations(); @JsonIgnore List<R> getRuntimeInfos(); @JsonProperty(access = JsonProperty.Access.READ_ONLY) Links getLinks(); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString();  }
@Test public void extractsConfigurationsFromGroupResults() { List<String> groups = asList("group1", "group2", "group3"); Map<String, TestConfiguration> configurationPerGroup = configurationsFor(groups); List<EntityGroupInfo<TestConfiguration, TestRuntimeInfo>> groupResults = createGroupResults(configurationPerGroup, runtimeInfosFor(groups)); EntityInfo<TestConfiguration, TestRuntimeInfo> entityInfo = new EntityInfo<>("some.element.id", groupResults); Collection<TestConfiguration> configurationsForAllGroups = configurationPerGroup.values(); assertThat(entityInfo.getConfigurations()) .containsExactlyInAnyOrderElementsOf(configurationsForAllGroups); }