void () { try { if (consumer instanceof Closeable) { executeImpl(() -> { try { ((Closeable)consumer).close(); } catch (IOException ex) { ExceptionUtil.rethrow(ex); } }); } } finally { closed = true; } }