import com.google.common.base.Optional;
import com.google.common.base.Predicate;
import com.google.common.base.Predicates;
-import com.google.common.collect.Collections2;
import com.google.common.collect.FluentIterable;
import com.google.common.collect.HashMultimap;
import com.google.common.collect.ImmutableSet;
@Override
public Collection<Sone> getLocalSones() {
synchronized (sones) {
- return Collections2.filter(sones.values(), new Predicate<Sone>() {
+ return FluentIterable.from(sones.values()).filter(new Predicate<Sone>() {
@Override
public boolean apply(Sone sone) {
return sone.isLocal();
}
- });
+ }).toSet();
}
}
@Override
public Collection<Sone> getRemoteSones() {
synchronized (sones) {
- return Collections2.filter(sones.values(), new Predicate<Sone>() {
+ return FluentIterable.from(sones.values()).filter(new Predicate<Sone>() {
@Override
public boolean apply(Sone sone) {
return !sone.isLocal();
}
- });
+ }).toSet();
}
}