public <T> WeakReference<T> getWeakRef() {
        if (weakRef == null) {
            weakRef = new WeakReference<>(this);
        }
        return (WeakReference<T>) weakRef;
    }
Acquire a weak reference to this NativeObject.

@param <T> the type
@return a weak reference (possibly a pre-existing one)
jme3-core/src/main/java/com/jme3/util/NativeObject.java