docs: public static <T> List<T> readList(ObjectDataInput in) throws IOException {
          int size = in.readInt();
          if (size == 0) {
              return Collections.emptyList();
          }
          List<T> list = new ArrayList<>(size);
          for (int i = 0; i < size; i++) {
              T item = in.readObject();
              list.add(item);
          }
          return list;
      }