Use nested classes for FieldComparator and MethodComparator.