efficient and clean way to do equals with Java 8