code: public void nextStep(O observation, Collection<S> candidates,
              Map<S, Double> emissionLogProbabilities,
              Map<Transition<S>, Double> transitionLogProbabilities,
              Map<Transition<S>, D> transitionDescriptors) {
          if (message == null) {
              throw new IllegalStateException(
                      "startWithInitialStateProbabilities() or startWithInitialObservation() "
                      + "must be called first.");
          }
          if (isBroken) {
              throw new IllegalStateException("Method must not be called after an HMM break.");
          }
  
          // Forward step
          ForwardStepResult<S, O, D> forwardStepResult = forwardStep(observation, prevCandidates,
                  candidates, message, emissionLogProbabilities, transitionLogProbabilities,
                  transitionDescriptors);
          isBroken = hmmBreak(forwardStepResult.newMessage);
          if (isBroken) return;
          if (messageHistory != null) {
              messageHistory.add(forwardStepResult.newMessage);
          }
          message = forwardStepResult.newMessage;
          lastExtendedStates = forwardStepResult.newExtendedStates;
  
          prevCandidates = new ArrayList<>(candidates); // Defensive copy.
      }
docs: Processes the next time step. Must not be called if the HMM is broken.
  
  @param candidates Pass a collection with predictable iteration order such as
  {@link ArrayList} to ensure deterministic results.
  @param emissionLogProbabilities Emission log probabilities for each candidate state.
  
  @param transitionLogProbabilities Transition log probability between all pairs of candidates.
  A transition probability of zero is assumed for every missing transition.
  
  @param transitionDescriptors Optional objects that describes the transitions.
  
  @throws NullPointerException if any emission probability is missing
  
  @throws IllegalStateException if neither
  {@link #startWithInitialStateProbabilities(Collection, Map)} nor
  {@link #startWithInitialObservation(Object, Collection, Map)}
  has not been called before or if this method is called after an HMM break has occurred