code: public TableFactor observe(int variable, final int value) {
      return marginalize(variable, 0, (marginalizedVariableValue, assignment) -> {
        if (marginalizedVariableValue == value) {
          return (old, n) -> {
            // This would mean that we're observing something with 0 probability, which will wonk up downstream
            // stuff
            // assert(n != 0);
            assert !Double.isNaN(n);
            return n;
          };
        } else {
          return (old, n) -> {
            assert !Double.isNaN(old);
            return old;
          };
        }
      });
    }
docs: Remove a variable by observing it at a certain value, return a new factor without that variable.
  
  @param variable the variable to be observed
  @param value    the value the variable takes when observed
  @return a new factor with 'variable' in it