code: public Factor addStaticBinaryFactor(int a, int cardA, int b, int cardB, BiFunction<Integer, Integer, Double> value) {
      return addStaticFactor(new int[]{a, b}, new int[]{cardA, cardB}, assignment -> value.apply(assignment[0], assignment[1]));
    }
docs: Add a binary factor, where we just want to hard-code the value of the factor.
  
  @param a The index of the first variable.
  @param cardA The cardinality (i.e, dimension) of the first factor
  @param b The index of the second variable
  @param cardB The cardinality (i.e, dimension) of the second factor
  @param value A mapping from assignments of the two variables, to a factor value.
  
  @return a reference to the created factor. This can be safely ignored, as the factor is already saved in the model