class LookupResultItem implements Comparable<LookupResultItem> {

    private final String phrase;

    private final Set<String> projects = new HashSet<>();

    private long score;

    LookupResultItem(final String phrase, final String project, final long score) {
        this.phrase = phrase;
        this.projects.add(project);
        this.score = score;
    }

    public String getPhrase() {
        return phrase;
    }

    public Set<String> getProjects() {
        return Collections.unmodifiableSet(projects);
    }

    public long getScore() {
        return score;
    }

    /**
     * Combines score and projects with the other instance with the same {@code phrase}.
     * @param other instance to combine with
     */
    void combine(final LookupResultItem other) {<FILL_FUNCTION_BODY>}

    private boolean canBeCombinedWith(final LookupResultItem other) {
        return phrase.equals(other.phrase);
    }

    @Override
    public int compareTo(final LookupResultItem other) {
        return Long.compare(score, other.score);
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        LookupResultItem that = (LookupResultItem) o;
        return score == that.score &&
                Objects.equals(phrase, that.phrase) &&
                Objects.equals(projects, that.projects);
    }

    @Override
    public int hashCode() {
        return Objects.hash(phrase, projects, score);
    }

    @Override
    public String toString() {
        return "LookupResultItem{phrase='" + phrase + "', projects=" + projects + ", score=" + score + '}';
    }
}

        if (other == null || !canBeCombinedWith(other)) {
            throw new IllegalArgumentException("Cannot combine with " + other);
        }
        projects.addAll(other.projects);
        score += other.score;
    
<no_super_class>