From ce58ae7224b867106e255b5b8c345817dd3ed094 Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Thu, 4 Jul 2013 19:29:24 +0200 Subject: [PATCH] Use fluent iterable for filtering. --- src/main/java/net/pterodactylus/sone/core/Core.java | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/main/java/net/pterodactylus/sone/core/Core.java b/src/main/java/net/pterodactylus/sone/core/Core.java index 03d331d..7232b72 100644 --- a/src/main/java/net/pterodactylus/sone/core/Core.java +++ b/src/main/java/net/pterodactylus/sone/core/Core.java @@ -92,7 +92,6 @@ import net.pterodactylus.util.thread.NamedThreadFactory; 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; @@ -361,13 +360,13 @@ public class Core extends AbstractService implements SoneProvider, PostProvider, @Override public Collection getLocalSones() { synchronized (sones) { - return Collections2.filter(sones.values(), new Predicate() { + return FluentIterable.from(sones.values()).filter(new Predicate() { @Override public boolean apply(Sone sone) { return sone.isLocal(); } - }); + }).toSet(); } } @@ -402,13 +401,13 @@ public class Core extends AbstractService implements SoneProvider, PostProvider, @Override public Collection getRemoteSones() { synchronized (sones) { - return Collections2.filter(sones.values(), new Predicate() { + return FluentIterable.from(sones.values()).filter(new Predicate() { @Override public boolean apply(Sone sone) { return !sone.isLocal(); } - }); + }).toSet(); } } -- 2.7.4