@SuppressWarnings(value = "unchecked")
    @Override
    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        }
        if (getClass() != obj.getClass()) {
            return false;
        }
        // next line makes compiler complain for unsafe check
        // but seems right to me: if obj is not instance of T
        // then line above return false
        // and cast will never be executed
        final DisjointSet<T> other = (DisjointSet<T>) obj;
        if (this.representant != other.representant && (this.representant == null || !this.representant.equals(other.representant))) {
            return false;
        }
        return true;
    }