code: public static boolean safeClose(Closeable c) {
          if (c == null) {
              LOG.debug("trying to call .close() on null reference");
              return true;
          }
          try {
              c.close();
              return true;
          } catch (final IOException e) {
              LOG.error("Error while closing '{}': ", c, e);
              return false;
          }
      }
docs: Closes the given {@link Closeable} and logs any error that occurs.
  
  @param c The {@link Closeable}. Might be <code>null</code>.
  @return Whether closing was successful. That is, the input was not
  <code>null</code> and its {@link Closeable#close()} method did
  not throw an exception.