RowFilter ( final String right, final int modelIndex, final FormatWrapper format, final Comparator stringComparator) { return new RowFilter() { @Override public boolean include(Entry entry) { Object left = entry.getValue(modelIndex); String value = format.format(left); return expected == (stringComparator.compare(value, right) == 0); } }; }