@Nullable
  public static <T> CloseableReference<T> cloneOrNull(@Nullable CloseableReference<T> ref) {
    return (ref != null) ? ref.cloneOrNull() : null;
  }
Returns the cloned reference if valid, null otherwise.

@param ref the reference to clone
fbcore/src/main/java/com/facebook/common/references/CloseableReference.java