src/main/java/org/mstepan/advanced/ds/geometry/KDTree.java
private boolean isEquals(T first, T second) {
        for (int dim = 0; dim < dimensionsCount; ++dim) {
            if (first.compareWith(second, dim) != 0) {
                return false;
            }
        }

        return true;
    }
/**
     * It's better to use comparison for equality testing, in this way we don't need to rely on equals implementation.
     * Just iterate over all possible dimensions and compare each value from each dimension for two objects.
     */
It's better to use comparison for equality testing, in this way we don't need to rely on equals implementation.
Just iterate over all possible dimensions and compare each value from each dimension for two objects.
It ' s better to use comparison for equality testing in this way we don ' t need to rely on equals implementation . Just iterate over all possible dimensions and compare each value from each dimension for two objects .
private boolean isEquals(T first, T second) {
        for (int dim = 0; dim < dimensionsCount; ++dim) {
            if (first.compareWith(second, dim) != 0) {
                return false;
            }
        }
        return true;
    }
private boolean isEquals ( T first , T second ) { for ( int dim = 0 ; dim < dimensionsCount ; ++ dim ) { if ( first . compareWith ( second , dim ) != 0 ) { return false ; } } return true ; }
It's better to use comparison for equality testing, in this way we don't need to rely on equals implementation.
It ' s better to use comparison for equality testing in this way we don ' t need to rely on equals implementation .