code: public void close(AutoCloseable closeable) {
      try {
        closeable.close();
      } catch (Exception e) {
        throw new IllegalStateException("Fail to close " + closeable, e);
      }
    }
docs: Closes the object and throws an {@link java.lang.IllegalStateException} on error.
  @since 5.1