- /** Comparator that sorts replies ascending by time. */
- public static final Comparator<? super Reply<?>> TIME_COMPARATOR = new Comparator<Reply<?>>() {
-
- /**
- * {@inheritDoc}
- */
- @Override
- public int compare(Reply<?> leftReply, Reply<?> rightReply) {
- return (int) Math.max(Integer.MIN_VALUE, Math.min(Integer.MAX_VALUE, leftReply.getTime() - rightReply.getTime()));
- }
-
- };
-