code: private void writeHelper(Consumer<Client> consumer, Collection<? extends Client> clients) {
          var toExclude = Collections.newSetFromMap(new IdentityHashMap<>(clients.size()));
          toExclude.addAll(clients);
          connectedClients.stream().filter(Predicate.not(toExclude::contains)).forEach(consumer);
      }
docs: A helper method that eliminates code duplication in the {@link #writeToAllExcept(Packet, Collection)} and
  {@link #writeAndFlushToAllExcept(Packet, Collection)} methods.
  
  @param consumer The action to perform for each {@link Client}.
  @param clients A {@link Collection} of {@link Client}s to exclude from receiving the {@link Packet}.