code: private static Collection<IOException> addException(
        @Nullable Collection<IOException> exceptions, IOException e) {
      if (exceptions == null) {
        exceptions = new ArrayList<>(); // don't need Set semantics
      }
      exceptions.add(e);
      return exceptions;
    }
docs: Adds the given exception to the given collection, creating the collection if it's null. Returns
  the collection.