Custom Object Comparator in Java used for Sorting - Generalized for most common data types.