@Test public void testApplyWithComparator() { CollectorFormatter f = new CollectorFormatter("{3}", (Formatter) null, SeverityComparator.getInstance()); LogRecord first = new LogRecord(Level.SEVERE, ""); LogRecord second = new LogRecord(Level.WARNING, ""); assertSame(first, f.apply(first, second)); }
protected LogRecord apply(final LogRecord t, final LogRecord u) { if (t == null || u == null) { throw new NullPointerException(); } if (comparator != null) { return comparator.compare(t, u) >= 0 ? t : u; } else { return u; } }
CollectorFormatter extends Formatter { protected LogRecord apply(final LogRecord t, final LogRecord u) { if (t == null || u == null) { throw new NullPointerException(); } if (comparator != null) { return comparator.compare(t, u) >= 0 ? t : u; } else { return u; } } }
CollectorFormatter extends Formatter { protected LogRecord apply(final LogRecord t, final LogRecord u) { if (t == null || u == null) { throw new NullPointerException(); } if (comparator != null) { return comparator.compare(t, u) >= 0 ? t : u; } else { return u; } } CollectorFormatter();  CollectorFormatter(String format);  CollectorFormatter(String format, Formatter f,
            Comparator<? super LogRecord> c); }
CollectorFormatter extends Formatter { protected LogRecord apply(final LogRecord t, final LogRecord u) { if (t == null || u == null) { throw new NullPointerException(); } if (comparator != null) { return comparator.compare(t, u) >= 0 ? t : u; } else { return u; } } CollectorFormatter();  CollectorFormatter(String format);  CollectorFormatter(String format, Formatter f,
            Comparator<? super LogRecord> c); @Override String format(final LogRecord record); @Override String getTail(final Handler h); @Override String toString(); }
CollectorFormatter extends Formatter { protected LogRecord apply(final LogRecord t, final LogRecord u) { if (t == null || u == null) { throw new NullPointerException(); } if (comparator != null) { return comparator.compare(t, u) >= 0 ? t : u; } else { return u; } } CollectorFormatter();  CollectorFormatter(String format);  CollectorFormatter(String format, Formatter f,
            Comparator<? super LogRecord> c); @Override String format(final LogRecord record); @Override String getTail(final Handler h); @Override String toString();  }