code: public void assertExactlyOneDefined(final String... params) {
      int definedCount = 0;
      for (final String param : params) {
        if (isPresent(param)) {
          if (++definedCount == 2) {
            // No point in going past two
            break;
          }
        }
      }
      if (definedCount != 1) {
        throw new ParameterException(
            String.format("Exactly one of %s must be defined.",
                StringUtils.CommaSpaceJoiner.join(params)));
      }
    }
docs: Throws a ParameterException unless exactly one parameter is defined.