Sho SHIMIZU
Committed by Sho Shimizu

Simplify method

Change-Id: I3d04245fb5462e0750c3bcfa687946742d44644f
......@@ -97,8 +97,7 @@ final class EncodableDiscreteResources implements DiscreteResources {
@Override
public boolean containsAny(Set<DiscreteResource> other) {
return other.stream()
.anyMatch(x -> values().contains(x));
return !Sets.intersection(this.values(), other).isEmpty();
}
@Override
......
......@@ -68,7 +68,7 @@ final class GenericDiscreteResources implements DiscreteResources {
@Override
public boolean containsAny(Set<DiscreteResource> other) {
return other.stream().anyMatch(values::contains);
return !Sets.intersection(this.values(), other).isEmpty();
}
// returns a new instance, not mutate the current instance
......