code: @CanIgnoreReturnValue
    static Object checkElementNotNull(Object element, int index) {
      if (element == null) {
        throw new NullPointerException("at index " + index);
      }
      return element;
    }
docs: creation cost.