code: private String generateInvalidErrorMessage(Object[] enumValues, String testValue)
      {
          StringBuffer errorMessage = new StringBuffer("Unable to convert value [" + testValue + "].");
  
          errorMessage.append(" Allowed values are (case insensitive) ");
  
          StringBuffer valueList = new StringBuffer();
  
          int index = 1;
          for (Object enumValue : enumValues) {
              if (valueList.length() > 0) {
                  if (++index == enumValues.length) {
                      valueList.append(" or ");
                  } else {
                      valueList.append(", ");
                  }
              }
  
              valueList.append('"');
              valueList.append(enumValue);
              valueList.append('"');
          }
  
          errorMessage.append(valueList);
          errorMessage.append('.');
  
          return errorMessage.toString();
      }
docs: Generate error message to use in the {@link ConversionException}.
  
  @param enumValues possible values of the enum.
  @param testValue the value to convert.
  @return the generated error message.