Using Objects.equals() to simplify the equals() logic