public static void closeSafely(@Nullable Iterable<? extends CloseableReference<?>> references) {
    if (references != null) {
      for (CloseableReference<?> ref : references) {
        closeSafely(ref);
      }
    }
  }
Closes the references in the iterable handling null.

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