// comparing first Set to another // using equals() method boolean value = sortedSet1.equals(sortedSet2); // same way used in // // comparing arrays // print the value System.out.println("Are both set equal? " + value);