public static boolean isValidVector(Vector2f vector) {
        if (vector == null) {
            return false;
        }
        if (Float.isNaN(vector.x)
                || Float.isNaN(vector.y)) {
            return false;
        }
        if (Float.isInfinite(vector.x)
                || Float.isInfinite(vector.y)) {
            return false;
        }
        return true;
    }
Tests whether the argument is a valid vector, returning false if it's
null or if any component is NaN or infinite.

@param vector the vector to test (unaffected)
@return true if non-null and finite, otherwise false
jme3-core/src/main/java/com/jme3/math/Vector2f.java