code: public Weight invertSign() {
          if (isInfinity) {
              if (posOrNeg) {
                  return WeightFactory.NEG_INFINITY;
              } else {
                  return WeightFactory.POS_INFINITY;
              }
          }
          return new Weight(-val);
      }
docs: Creates a new weight with the opposite sign.
  
  @return a new <code>Weight</code>.