public boolean equals(Object obj) {
    if (this == obj) {
      return true;
    }
    if (!(obj instanceof ZoomOptions otherOptions)) {
      return false;
    }

    Dimension prefferedSize = otherOptions.getPrefferedSize();
    return prefferedSize != null && prefferedHeight == prefferedSize.height &&
           prefferedWidth == prefferedSize.width;
  }
public boolean equals(Object obj)