public static void closeAll(Closeable... closeables) throws IOException {
        IOException exception = null;
        for (Closeable closeable : closeables) {
            try {
                if (closeable != null)
                    closeable.close();
            } catch (IOException e) {
                if (exception != null)
                    exception.addSuppressed(e);
                else
                    exception = e;
            }
        }
        if (exception != null)
            throw exception;
    }
Closes all the provided closeables.
@throws IOException if any of the close methods throws an IOException.
        The first IOException is thrown with subsequent exceptions
        added as suppressed exceptions.
clients/src/main/java/org/apache/kafka/common/utils/Utils.java