code: public static <T> List<T> readNullableList(ObjectDataInput in) throws IOException {
          boolean isNull = !in.readBoolean();
          if (isNull) {
              return null;
          }
          return readList(in);
      }
docs: Reads a list from the given {@link ObjectDataInput}. It is expected that
  the next int read from the data input is the list's size, then that
  many objects are read from the data input and returned as a list.
  
  @param in    data input to read from
  @param <T>   type of items
  @return      list of items read from data input or null
  @throws IOException when an error occurs while reading from the input