class ResolvedIntersectionType implements ResolvedType {

    private List<ResolvedType> elements;

    public ResolvedIntersectionType(Collection<ResolvedType> elements) {
        if (elements.size() < 2) {
            throw new IllegalArgumentException("An intersection type should have at least two elements. This has " + elements.size());
        }
        this.elements = new LinkedList<>(elements);
    }

    @Override
    public boolean equals(Object o) {<FILL_FUNCTION_BODY>}

    @Override
    public int hashCode() {
        return new HashSet<>(elements).hashCode();
    }

    @Override
    public String describe() {
        return String.join(" & ", elements.stream().map(ResolvedType::describe).collect(Collectors.toList()));
    }

    @Override
    public boolean isAssignableBy(ResolvedType other) {
        return elements.stream().allMatch(e -> e.isAssignableBy(other));
    }

    @Override
    public ResolvedType replaceTypeVariables(ResolvedTypeParameterDeclaration tp, ResolvedType replaced, Map<ResolvedTypeParameterDeclaration, ResolvedType> inferredTypes) {
        List<ResolvedType> elementsReplaced = elements.stream().map(e -> e.replaceTypeVariables(tp, replaced, inferredTypes)).collect(Collectors.toList());
        if (elementsReplaced.equals(elements)) {
            return this;
        }
        return new ResolvedIntersectionType(elementsReplaced);
    }

    /*
     * Returns the list of the resolved types
     */
    public List<ResolvedType> getElements() {
        return elements;
    }
}

        if (this == o)
            return true;
        if (o == null || getClass() != o.getClass())
            return false;
        ResolvedIntersectionType that = (ResolvedIntersectionType) o;
        return new HashSet<>(elements).equals(new HashSet<>(that.elements));
    
<no_super_class>