@Override
 public Iterator<Entry<Integer, Double>> getNestedTransitionsIterator(int s, int i, int j) {
   DistributionSet ds = trans.get(s).get(i);
   Iterator<Distribution> iter = ds.iterator();
   Distribution distr = null;
   int k = 0;
   while (iter.hasNext() && k <= j) {
     distr = iter.next();
     k++;
   }
   if (k <= j) return null;
   else return distr.iterator();
 }
 @Override
 public int getNumNestedTransitions(int s, int i, int j) {
   DistributionSet ds = trans.get(s).get(i);
   Iterator<Distribution> iter = ds.iterator();
   Distribution distr = null;
   int k = 0;
   while (iter.hasNext() && k <= j) {
     distr = iter.next();
     k++;
   }
   if (k <= j) return 0;
   else return distr.size();
 }