public class OrderedPairUsage { public static void main(String args[]) { Pair p1 = new OrderedPair<>(1, "Black"); Pair p2 = new OrderedPair<>(1, "Red"); boolean same = Util.compare(p1, p2); if( same ) { System.out.println("p1 is equal to p2"); } else { System.out.println("p1 is NOT equal to p2"); } } }