### Question:
ProctorSpecifications { public Set<String> getDynamicTests( final Map<String, ConsumableTestDefinition> definedTests ) { return this.specifications.stream() .map(s -> s.getDynamicFilters() .determineTests(definedTests, s.getTests().keySet()) ) .flatMap(Collection::stream) .collect(Collectors.toSet()); } 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 testGetDynamicTests() { final ProctorSpecification specA = new ProctorSpecification(); specA.setDynamicFilters( new DynamicFilters(Collections.singleton(exactNameMatching("a_test"))) ); final ProctorSpecification specB = new ProctorSpecification(); specB.setDynamicFilters( new DynamicFilters(Collections.singleton(exactNameMatching("b_test"))) ); final ProctorSpecifications specifications = new ProctorSpecifications(Arrays.asList(specA, specB)); final Map<String, ConsumableTestDefinition> requiredTests = ImmutableMap.of( "a_test", stubTestDefinition(), "b_test", stubTestDefinition(), "c_test", stubTestDefinition() ); assertThat(specifications.getDynamicTests(requiredTests)) .containsOnly("a_test", "b_test"); }