boolean (Object object) { if (!(object instanceof ActionUrl url)) { return false; } Object comp = myComponent instanceof Pair ? ((Pair<?, ?>)myComponent).first : myComponent; Object thatComp = url.myComponent instanceof Pair ? ((Pair<?, ?>)url.myComponent).first : url.myComponent; return Comparing.equal(comp, thatComp) && myGroupPath.equals(url.myGroupPath) && myAbsolutePosition == url.myAbsolutePosition && myActionType == url.myActionType; }