public static < T , E extends Exception > Consumer < T > sneaked ( SneakyConsumer < T , E > consumer ) { return t -> { @ SuppressWarnings ( "unchecked" ) SneakyConsumer < T , RuntimeException > casedConsumer = ( SneakyConsumer < T , RuntimeException > ) consumer ; casedConsumer . accept ( t ) ; } ; }
Sneaky throws a Consumer lambda .