presto-main/src/main/java/io/prestosql/util/AutoCloseableCloser.java/AutoCloseableCloser/close
class AutoCloseableCloser:    @Override
    public void close()
            throws Exception
    {
        Throwable rootCause = null;
        while (!stack.isEmpty()) {
            AutoCloseable closeable = stack.removeFirst();
            try {
                closeable.close();
            }
            catch (Throwable t) {
                if (rootCause == null) {
                    rootCause = t;
                }
                else if (rootCause != t) {
                    // Self-suppression not permitted
                    rootCause.addSuppressed(t);
                }
            }
        }
        if (rootCause != null) {
            propagateIfPossible(rootCause, Exception.class);
            // not possible
            throw new AssertionError(rootCause);
        }
    }