Collections.sort(fields, new FieldComparator());
/** * Do we handle this Field? * * @param field * the field to interrogate * @return true if we can handle it, false otherwise */ private boolean filter(final Field field) { return FieldComparator.sortValueFor(field) < Integer.MAX_VALUE; }
@Override public int compare(final Field first, final Field second) { return sortValueFor(first) - sortValueFor(second); } }