I don't think you need the outer parens here.

What do you think about also changing the flow to something like this to reduce the indentation level:

  if (!mode1.equals(mode2))
    return false;

  return id1 != null ? id1.equals(id2) : id2 == null;