### Question:
ProctorSpecifications { public Map<String, Collection<TestSpecification>> getRequiredTests() { final ImmutableMultimap.Builder<String, TestSpecification> builder = ImmutableMultimap.builder(); specifications.forEach(specification -> specification.getTests().forEach(builder::put) ); return builder.build().asMap(); } ProctorSpecifications(
            final Iterable<ProctorSpecification> specifications
    ); @JsonValue Set<ProctorSpecification> asSet(); Map<String, Collection<TestSpecification>> getRequiredTests(); Set<String> getDynamicTests(
            final Map<String, ConsumableTestDefinition> definedTests
    ); Set<String> getResolvedTests(
            final Map<String, ConsumableTestDefinition> definedTests
    );  }### Answer:
@Test public void testGetRequiredTests() { final ProctorSpecification specA = new ProctorSpecification(); specA.setTests(ImmutableMap.of( "a_test", stubTestSpecification(), "b_test", stubTestSpecification() )); final ProctorSpecification specB = new ProctorSpecification(); specB.setTests(ImmutableMap.of( "b_test", stubTestSpecification(), "c_test", stubTestSpecification() )); final ProctorSpecifications specifications = new ProctorSpecifications(Arrays.asList(specA, specB)); assertThat(specifications.getRequiredTests()) .containsOnlyKeys("a_test", "b_test", "c_test") .hasEntrySatisfying("a_test", e -> assertThat(e).hasSize(1)) .hasEntrySatisfying("b_test", e -> assertThat(e).hasSize(2)) .hasEntrySatisfying("c_test", e -> assertThat(e).hasSize(1)); }