+ /**
+ * Compares both customer instances. This method returns -1 if second
+ * instance is null.
+ * <p>
+ * @param customer1 Customer instance 1
+ * @param customer2 Customer instance 2
+ * <p>
+ * @return Comparison value
+ */
+ public static int compare (final Customer customer1, final Customer customer2) {
+ // Check euqality, then at least first must be given
+ if (Objects.equals(customer1, customer2)) {
+ // Both are same
+ return 0;
+ } else if (null == customer1) {
+ // First is null
+ return -1;
+ } else if (null == customer2) {
+ // Second is null
+ return 1;
+ }
+
+ // Invoke compareTo() method
+ return customer1.compareTo(customer2);
+ }
+