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