simplified overly complex boolean expression in method equals()