code: public Datum<E> add(E x, int y) {
          if (response == null) {
              throw new IllegalArgumentException(DATASET_HAS_NO_RESPONSE);
          }
          
          if (response.getType() != Attribute.Type.NOMINAL) {
              throw new IllegalArgumentException(RESPONSE_NOT_NOMINAL);
          }
          
          return add(new Datum<>(x, y));
      }
docs: Add a datum item into the dataset.
  @param x a datum item.
  @param y the class label of the datum.
  @return the added datum item.