code: private static void add(State fromState, State toState, double weight, HashMap<Integer,Double>[] closure, Semiring semiring) {
      Double old = getPathWeight(fromState, toState, closure);
      if (old == null) {
        put(fromState, toState, weight, closure);
      } else {
        put(fromState, toState, semiring.plus(weight, old), closure);
      }
  
    }
docs: Add a state in the epsilon closure