code: private void setExtendedProperty(String property, Object value) {
          String dataType = extendedPropertiesDataType.get(property);
          String valueClass = value.getClass().getSimpleName();
  
          if (dataType.equals(valueClass) && !extendedMultiValuedProperties.contains(property)) {
              extendedPropertiesValue.put(property, value);
          } else if (dataType.equals(valueClass) && extendedMultiValuedProperties.contains(property)) {
              if (value instanceof List) {
                  extendedPropertiesValue.put(property, value);
              } else {
                  List<Object> values = (List<Object>) extendedPropertiesValue.get(property);
                  if (values == null) {
                      values = new ArrayList<Object>();
                      extendedPropertiesValue.put(property, values);
                  }
                  values.add(value);
              }
          } else {
              String type = value == null ? "null" : value.getClass().getName();
              String msg = "Could not set extended property for Group property '" + property + "'. " + type + " is incompatible with " + dataType;
              throw new ClassCastException(msg);
          }
      }
docs: Set an extended property's value.
  
  @param property The property to set.
  @param value The value to set.
  @throws ClassCastException If the value was not of the correct data type.