code: static Throwable tryClose(AutoCloseable closeable, boolean logWarning) {
          Throwable thrown = null;
          if (closeable != null) {
              try {
                  closeable.close();
              } catch (Exception e) {
                  thrown = e;
                  if (logWarning) {
                      LOG.warning("Caught exception during close(): " + e);
                  }
              }
          }
          return thrown;
      }
docs: Attempts to close the closeable returning rather than throwing
  any Exception that may occur.
  
  @param closeable the thing to close
  @param logWarning if true will log a warning if an exception occurs
  @return throwable Exception from the close method, else null