docs: public static <T> void writeCollection(Collection<T> items, ObjectDataOutput out) throws IOException {
          out.writeInt(items.size());
          for (T item : items) {
              out.writeObject(item);
          }
      }