@Test public void testResolve() { Location src = new InterfaceLinkLocation("n1", "i1"); Location nonSrc = new InterfaceLinkLocation("n2", "i2"); SpecifierContext ctxt = MockSpecifierContext.builder() .setLocationInfo( ImmutableMap.of( src, new LocationInfo(true, EmptyIpSpace.INSTANCE, EmptyIpSpace.INSTANCE), nonSrc, new LocationInfo(false, EmptyIpSpace.INSTANCE, EmptyIpSpace.INSTANCE))) .build(); assertThat(AllSources.ALL_SOURCES.resolve(ctxt), contains(src)); }
@Override public Set<Location> resolve(SpecifierContext ctxt) { return ctxt.getLocationInfo().entrySet().stream() .filter(entry -> entry.getValue().isSource()) .map(Entry::getKey) .collect(ImmutableSet.toImmutableSet()); }
AllSources implements LocationSpecifier { @Override public Set<Location> resolve(SpecifierContext ctxt) { return ctxt.getLocationInfo().entrySet().stream() .filter(entry -> entry.getValue().isSource()) .map(Entry::getKey) .collect(ImmutableSet.toImmutableSet()); } }
AllSources implements LocationSpecifier { @Override public Set<Location> resolve(SpecifierContext ctxt) { return ctxt.getLocationInfo().entrySet().stream() .filter(entry -> entry.getValue().isSource()) .map(Entry::getKey) .collect(ImmutableSet.toImmutableSet()); } private  AllSources(); }
AllSources implements LocationSpecifier { @Override public Set<Location> resolve(SpecifierContext ctxt) { return ctxt.getLocationInfo().entrySet().stream() .filter(entry -> entry.getValue().isSource()) .map(Entry::getKey) .collect(ImmutableSet.toImmutableSet()); } private  AllSources(); @Override Set<Location> resolve(SpecifierContext ctxt); }
AllSources implements LocationSpecifier { @Override public Set<Location> resolve(SpecifierContext ctxt) { return ctxt.getLocationInfo().entrySet().stream() .filter(entry -> entry.getValue().isSource()) .map(Entry::getKey) .collect(ImmutableSet.toImmutableSet()); } private  AllSources(); @Override Set<Location> resolve(SpecifierContext ctxt); static final AllSources ALL_SOURCES; }