code: public static void close(Closeable c) {
          if(c != null) {
              try {
                  c.close();
              } catch(IOException e) {
                  logger.error("Error closing stream", e);
              }
          }
      }
docs: Closes a Closeable and logs a potential error instead of re-throwing the
  exception. If {@code null} is passed, this method is a no-op.
  
  This is typically used in finally blocks to prevent an exception thrown
  during close from hiding an exception thrown inside the try.
  
  @param c The Closeable to close, may be null.