SeverityComparator implements Comparator<LogRecord>, Serializable { public int compare(final LogRecord o1, final LogRecord o2) { if (o1 == null || o2 == null) { throw new NullPointerException(toString(o1, o2)); } if (o1 == o2) { return 0; } int cmp = compare(o1.getLevel(), o2.getLevel()); if (cmp == 0) { cmp = applyThenCompare(o1.getThrown(), o2.getThrown()); if (cmp == 0) { cmp = compare(o1.getSequenceNumber(), o2.getSequenceNumber()); if (cmp == 0) { cmp = compare(o1.getMillis(), o2.getMillis()); } } } return cmp; }  Throwable apply(final Throwable chain); final int applyThenCompare(Throwable tc1, Throwable tc2); int compareThrowable(final Throwable t1, final Throwable t2); int compare(final LogRecord o1, final LogRecord o2); @Override boolean equals(final Object o); @Override int hashCode(); boolean isNormal(final Throwable t);  }
@Test(expected = NullPointerException.class) public void testCompareNullAndNull() { SeverityComparator a = new SeverityComparator(); a.compare((LogRecord) null, (LogRecord) null); }