@Override
    public boolean equals(Object o) {
        if (o == this) return true;
        if ( ! (o instanceof QueryProfileType other)) return false;
        return other.getId().equals(this.getId());
    }
Two types are equal if they have the same id
container-search/src/main/java/com/yahoo/search/query/profile/types/QueryProfileType.java