code: protected Set<Integer> getLabelIndices(Set<L> labels) {
      Set<Integer> iLabels = new HashSet<Integer>();
      for (L label:labels) {
        int iLabel = labelIndex.indexOf(label);
        iLabels.add(iLabel);
        if (iLabel < 0) throw new IllegalArgumentException("Unknown label " + label);
      }
      return iLabels;
    }
docs: Returns indices of labels
  @param labels - Set of labels to get indicies
  @return Set of indicies