code: public int[] getNonZeroIndices() {
          int[] indices = new int[values.size()];
          for (int i = 0; i < values.size(); ++i)
              indices[i] = values.get(i).index;
          return indices;
      }
docs: {@inheritDoc}