class UuidConverter implements ConditionalConverter<Object, UUID> {

  public UUID convert(MappingContext<Object, UUID> context) {<FILL_FUNCTION_BODY>}

  public MatchResult match(Class<?> sourceType, Class<?> destinationType) {
    boolean destMatch = destinationType == UUID.class;
    return destMatch ? isCharArray(sourceType) || sourceType == String.class
        ? MatchResult.FULL
        : MatchResult.PARTIAL
        : MatchResult.NONE;
  }

  private boolean isCharArray(Class<?> sourceType) {
    return sourceType.isArray() && (sourceType.getComponentType() == Character.TYPE
        || sourceType.getComponentType() == Character.class);
  }
}

    Object source = context.getSource();
    if (source == null) {
        return null;
    }

    Class<?> sourceType = context.getSourceType();
    if (isCharArray(sourceType)) {
      return UUID.fromString(new String((char[]) source));
    }
    return UUID.fromString(source.toString());
  
<no_super_class>