Objects utilities
The following two utilities are described in this section:
java.util.Objectsorg.apache.commons.lang3.ObjectUtils
They are especially useful during class creation, so we will concentrate largely on methods related to this task.
java.util.Objects class
The Objects class has only 17 methods that are all static. Let’s look at some of them while applying them to the Person class. Let’s assume this class will be an element of a collection, which means it has to implement the equals() and hashCode() methods. The code is illustrated in the following snippet:
class Person {
    private int age;
    private String name;
    public Person(int age, String name) {
        this.age = age;
        this.name = name;
    }
    public int getAge...