Make Size and Duration compatible with Java 6

Long#compare(long, long) was only introduces in Java 7.