@SuppressWarnings({"rawtypes","unchecked"}) private static Object toSet(Object value,Class<?> parameterType) throws GfJsonException {
  try {
    JSONArray array=(JSONArray)value;
    Set set=new HashSet();
    for (int i=0; i < array.length(); i++) {
      Object element=array.get(i);
      if (isPrimitiveOrWrapper(element.getClass())) {
        set.add(element);
      }
 else       throw new GfJsonException("Only primitive types are supported in set type for input commands");
    }
    return set;
  }
 catch (  JSONException e) {
    throw new GfJsonException(e);
  }
}

@ SuppressWarnings ( { "rawtypes" , "unchecked" } ) private static Object toSet ( Object value , Class < ? > parameterType ) throws GfJsonException { try { JSONArray array = ( JSONArray ) value ; Set set = new HashSet ( ) ; for ( int i = 0 ; i < array . length ( ) ; i ++ ) { Object element = array . get ( i ) ; if ( isPrimitiveOrWrapper ( element . getClass ( ) ) ) { set . add ( element ) ; } else throw new GfJsonException ( "Only primitive types are supported in set type for input commands" ) ; } return set ; } catch ( JSONException e ) { throw new GfJsonException ( e ) ; } }
this is used in put command this method uses hashset as default implementation
