code: private static boolean matchesType(
        Optional<PublicSuffixType> desiredType, Optional<PublicSuffixType> actualType) {
      return desiredType.isPresent() ? desiredType.equals(actualType) : actualType.isPresent();
    }
docs: If a {@code desiredType} is specified, returns true only if the {@code actualType} is
  identical. Otherwise, returns true as long as {@code actualType} is present.