code: private List<Object> toList(Class<?> valueType, Object arrayObject)
     {
        List<Object> defaultValues = new ArrayList<>();
        int length = Array.getLength(arrayObject);
        boolean isClassType = (valueType == Class.class);
        for (int i = 0; i < length; i++)
        {
           Object arrayValue = Array.get(arrayObject, i);
           if (isClassType)
           {
              arrayValue = ((Class<?>) arrayValue).getName();
           }
           defaultValues.add(arrayValue);
        }
        return defaultValues;
     }
docs: Converts an array to a {@link List}
  
  @param valueType
  @param arrayObject
  @return