public Set<ValueType> intersection(Set<ValueType> set1, Set<ValueType> set2) {
        Set<ValueType> crossSet = new Set<>();
        SetElement<ValueType> current = set1.head;
        if (!set1.isEmpty()) {
            while (current != set1.tail.getNext()) {
                if (set2.exist(current.getValue())) {
                    crossSet.addElement(current.getValue());
                }
                current = current.getNext();
            }
        }
        return crossSet;
    }