class CompositeException extends RuntimeException {

    Throwable getRootCause(Throwable e) {
        Throwable root = e.getCause();
        if (root == null || cause == root) {
            return e;
        }
        while (true) {
            Throwable cause = root.getCause();
            if (cause == null || cause == root) {
                return root;
            }
            root = cause;
        }
    }

    public  CompositeException(@NonNull Throwable... exceptions);
    public  CompositeException(@NonNull Iterable<? extends Throwable> errors);

}