33import static org .junit .jupiter .api .Assertions .assertFalse ;
44import static org .junit .jupiter .api .Assertions .assertTrue ;
55
6- import com .github .streams .learn .functional_interfaces .ignore .models .Person ;
76import java .util .Comparator ;
87import java .util .function .IntBinaryOperator ;
98import org .junit .jupiter .api .Test ;
1312 * Some of the exercises use a Person class, which is a simple POJO containing a last projectName,
1413 * first projectName, and age, with the obvious constructors and getters.
1514 */
16- public class B_Comparators {
15+ class B_Comparators {
16+
17+ public record Person (String name , String lastName , int age ) {}
1718
1819 final Person michael = new Person ("Michael" , "Jackson" , 51 );
1920 final Person rod = new Person ("Rod" , "Stewart" , 71 );
@@ -26,7 +27,7 @@ public class B_Comparators {
2627 * letters) is greater than TWO (three letters)
2728 */
2829 @ Test
29- public void comparator01 () {
30+ void comparator01 () {
3031 // TODO//Comparator<String> compareByLength = null;
3132 // BEGINREMOVE
3233 Comparator <String > compareByLength = Comparator .comparing (String ::length );
@@ -49,7 +50,7 @@ public void comparator01() {
4950 * same, then use the alphabetical order.
5051 */
5152 @ Test
52- public void comparator02 () {
53+ void comparator02 () {
5354 // TODO//Comparator<String> compareByLengthThenAlphabetical = null;
5455 // BEGINREMOVE
5556 Comparator <String > compareByLengthThenAlphabetical =
@@ -73,7 +74,7 @@ public void comparator02() {
7374
7475 /** Write a Comparator that compares instances of Person using their lastName. */
7576 @ Test
76- public void comparator03 () {
77+ void comparator03 () {
7778 // TODO//Comparator<Person> comparebyLastName = null;
7879 // BEGINREMOVE
7980 Comparator <Person > comparebyLastName = Comparator .comparing (Person ::lastName );
0 commit comments