code: public void setSparseFeature(ConcatVector vector, String featureName, Collection<String> sparseFeatures) {
          int[] indices = new int[sparseFeatures.size()];
          double[] values = new double[sparseFeatures.size()];
          int offset = 0;
          for (String index : sparseFeatures) {
              indices[offset] = ensureSparseFeature(featureName, index);
              values[offset] = 1.0;
              offset++;
          }
          vector.setSparseComponent(ensureFeature(featureName), indices, values);
      }
docs: This adds a sparse set feature to a vector, setting the appropriate components of the given vector to the passed
  in value.
  @param vector the vector
  @param featureName the feature whose value to set
  @param sparseFeatures the indices we wish to set, whose values will all be set to 1.0