Is it possible to run a method, in a consumer, like a method reference, but on the object passed to the consumer:
Arrays.stream(log.getHandlers()).forEach(h ->
Sure, but you must use the correct syntax of method reference, i.e. pass the class to which the close() method belong:
close()
Arrays.stream(log.getHandlers()).forEach(Handler::close);