code: public static <T, E extends Exception> Consumer<T> rethrowConsumer(ConsumerWithExceptions<T, E> consumer) throws E {
          return t -> {
              try {
                  consumer.accept(t);
              } catch (Exception exception) {
                  throwAsUnchecked(exception);
              }
          };
      }
docs: .forEach(rethrowConsumer(name -> System.out.println(Class.forName(name)))); or .forEach(rethrowConsumer(ClassNameUtil::println));