code: public static void postIfOnlyIf(ReconfigurationProblem rp, BoolVar b1, Constraint c2) {
          Model csp = rp.getModel();
          BoolVar notBC1 = b1.not();
          BoolVar bC2 = csp.boolVar(rp.makeVarLabel(c2.toString(), " satisfied"));
          c2.reifyWith(bC2);
          BoolVar notBC2 = bC2.not();
          csp.post(rp.getModel().or(rp.getModel().or(b1, bC2), rp.getModel().or(notBC1, notBC2)));
      }
docs: Make and post a constraint that states and(or(b1, non c2), or(non b1, c2))
  
  @param rp the problem to solve
  @param b1 the first constraint
  @param c2 the second constraint