diff --git a/meerkat-common/src/main/java/meerkat/util/BulletinBoardUtils.java b/meerkat-common/src/main/java/meerkat/util/BulletinBoardUtils.java index ca7e0d0..35bcd9f 100644 --- a/meerkat-common/src/main/java/meerkat/util/BulletinBoardUtils.java +++ b/meerkat-common/src/main/java/meerkat/util/BulletinBoardUtils.java @@ -39,9 +39,12 @@ public class BulletinBoardUtils { * @return BulletinBoardMessage */ public static BulletinBoardMessage getLatestMessage(Collection messages){ - return Collections.max(messages, (first, second) -> { - TimestampComparator comparator = new TimestampComparator(); - return comparator.compare(first.getMsg().getTimestamp(), second.getMsg().getTimestamp()); + return Collections.max(messages, new Comparator() { + @Override + public int compare(BulletinBoardMessage o1, BulletinBoardMessage o2) { + TimestampComparator comparator = new TimestampComparator(); + return comparator.compare(o1.getMsg().getTimestamp(), o2.getMsg().getTimestamp()); + } }); } diff --git a/meerkat-common/src/main/java/meerkat/util/TimeStampComparator.java b/meerkat-common/src/main/java/meerkat/util/TimeStampComparator.java index 1dc207b..ae193e8 100644 --- a/meerkat-common/src/main/java/meerkat/util/TimeStampComparator.java +++ b/meerkat-common/src/main/java/meerkat/util/TimeStampComparator.java @@ -7,7 +7,7 @@ import java.util.Comparator; /** * Created by Arbel Deutsch Peled on 20-Feb-16. */ -public class TimestampComparator implements Comparator { +public class TimestampComparator implements Comparator { @Override public int compare(Timestamp o1, Timestamp o2) { diff --git a/voter-registry/src/main/java/meerkat/registry/AsyncRegistryCallbacks/getVoterCallback.java b/voter-registry/src/main/java/meerkat/registry/AsyncRegistryCallbacks/getVoterCallback.java index 4c371f7..b1b8166 100644 --- a/voter-registry/src/main/java/meerkat/registry/AsyncRegistryCallbacks/getVoterCallback.java +++ b/voter-registry/src/main/java/meerkat/registry/AsyncRegistryCallbacks/getVoterCallback.java @@ -1,7 +1,7 @@ package meerkat.registry.AsyncRegistryCallbacks; import com.google.common.util.concurrent.FutureCallback; -import meerkat.protobuf.BulletinBoardAPI.*; +import meerkat.protobuf.BulletinBoardAPI.BulletinBoardMessage; import meerkat.protobuf.VoterRegistry; import meerkat.registry.RegistryTags;