methodConfig.getSampleSpec().getMatchingValueSets(form, sampleType);
final List<SampleValueSet> matchingValues = sampleSpec .getMatchingValueSets(CallingForm.Request, SampleType.STANDALONE) .stream() .map(vsat -> vsat.values())
@Test public void valueSetsReferencedMultipleTimes() { final MethodConfigProto methodConfigProto = MethodConfigProto.newBuilder() .addSampleValueSets(SampleValueSet.newBuilder().setId("alice")) .addSampleValueSets(SampleValueSet.newBuilder().setId("bob")) .setSamples( SampleConfiguration.newBuilder() .addStandalone( SampleTypeConfiguration.newBuilder() .addValueSets("alice") .addCallingForms(".*")) .addStandalone( SampleTypeConfiguration.newBuilder() .addValueSets("bob") .addCallingForms(".*")) .addStandalone( SampleTypeConfiguration.newBuilder() .addValueSets("alice") .addCallingForms(".*"))) .build(); SampleSpec sampleSpec = new SampleSpec(methodConfigProto); assertThat(sampleSpec.getMatchingValueSets(CallingForm.Request, SampleType.STANDALONE)) .hasSize(3); } }