@Override
    public boolean equals(Object o) {
        if (!(o instanceof Quaternion)) {
            return false;
        }

        if (this == o) {
            return true;
        }

        Quaternion comp = (Quaternion) o;
        if (Float.compare(x, comp.x) != 0) {
            return false;
        }
        if (Float.compare(y, comp.y) != 0) {
            return false;
        }
        if (Float.compare(z, comp.z) != 0) {
            return false;
        }
        if (Float.compare(w, comp.w) != 0) {
            return false;
        }
        return true;
    }
Tests for exact equality with the argument, distinguishing -0 from 0. If
{@code o} is null, false is returned. Either way, the current instance is
unaffected.

@param o the object to compare (may be null, unaffected)
@return true if {@code this} and {@code o} have identical values,
    otherwise false
jme3-core/src/main/java/com/jme3/math/Quaternion.java