Convert a two-dimensional array of Strings to a List of Lists, with
type-safe individual entries
@param oldData
@return New data
543491
public static List<List<DTCellValue52>> makeDataLists( Object[][] oldData ) {
        List<List<DTCellValue52>> newData = new ArrayList<List<DTCellValue52>>();
        for ( int iRow = 0; iRow < oldData.length; iRow++ ) {
            Object[] oldRow = oldData[ iRow ];
            List<DTCellValue52> newRow = makeDataRowList( oldRow );
            newData.add( newRow );
        }
        return newData;
    }
1197912
public static final DumbData[][] createDatas(final int[] pDatasPerRevision) {
        final DumbData[][] returnVal = new DumbData[pDatasPerRevision.length][];
        for (int i = 0; i < pDatasPerRevision.length; i++) {
            returnVal[i] = new DumbData[pDatasPerRevision[i]];
            for (int j = 0; j < pDatasPerRevision[i]; j++) {
                returnVal[i][j] = generateOne();
            }
        }
        return returnVal;
    }
820567
private ArrayList<E> toArrayList() {
        ArrayList<E> list = new ArrayList<>();
        for (Node<E> p = first(); p != null; p = succ(p)) {
            E item = p.item;
            if (item != null)
                list.add(item);
        }
        return list;
    }
1144484
public function diff(array $oldData, array $newData)
    {
        $diff = [];
        $keys = array_keys($oldData + $newData);
        
        foreach ($keys as $field) {
            $old = array_key_exists($field, $oldData) ? $oldData[$field] : null;
            $new = array_key_exists($field, $newData) ? $newData[$field] : null;

            if ($old == $new) {
                $row = ['old' => '', 'new' => '', 'same' => $old];
            } else {
                $row = ['old' => $old, 'new' => $new, 'same' => ''];
            }

            $diff[$field] = $row;
        }

        return $diff;
    }
1044742
public static String[] objectListToStringArray(final List<?> objectList) {
		if( objectList == null ) {
			return null;
		}
		
		final String[] stringArray = new String[objectList.size()];
		for( int i = 0; i < objectList.size(); i++ ) {
			stringArray[i] = objectList.get(i) != null ? objectList.get(i).toString() : null;
		}
		
		return stringArray;
	}
378361
public static String[] strListToArray(List<String> list) {
		if (list == null)
			return new String[0];
		return list.toArray(new String[list.size()]);
	}
292257
public static <T> T[] toArray(List<T> list) {
    return toArray(getClass(list.get(0)), list);
  }
194779
public static List<String> toList(String[] input) {
        List<String> ret = new ArrayList<>();
        for (int i = 0; i < input.length; i++)
            ret.add(input[i]);
        return ret;
    }
342616
public <T> T[] convert(Object[] datas, Class<T> clazz) {
    if (null == datas) { return null; }
    @SuppressWarnings("unchecked")
    T[] newDatas = (T[]) Array.newInstance(clazz, datas.length);
    for (int i = 0; i < datas.length; i++) {
      newDatas[i] = convert(datas[i], clazz);
    }
    return newDatas;
  }
25656
@SuppressWarnings("unchecked")
    public static <T> T[] newArray(final T[] oldElements, final int length)
    {
        return (T[])Array.newInstance(oldElements.getClass().getComponentType(), length);
    }
229215
public static Array listToArray(String list, char delimiter) {
	if (list.length() == 0) return new ArrayImpl();
	int len = list.length();
	int last = 0;

	Array array = new ArrayImpl();
	try {
	    for (int i = 0; i < len; i++) {
		if (list.charAt(i) == delimiter) {
		    array.append(list.substring(last, i));
		    last = i + 1;
		}
	    }
	    if (last <= len) array.append(list.substring(last));
	}
	catch (PageException e) {}
	return array;
    }
1023622
private List<Row> createExceptionAssignmentRowList(String exceptionData)
   {
      List<Row> list = new ArrayList<Row>();
      String[] exceptions = exceptionData.split(",|:");
      int index = 1;
      while (index < exceptions.length)
      {
         Date startDate = DatatypeConverter.parseEpochTimestamp(exceptions[index + 0]);
         Date endDate = DatatypeConverter.parseEpochTimestamp(exceptions[index + 1]);
         //Integer exceptionTypeID = Integer.valueOf(exceptions[index + 2]);

         Map<String, Object> map = new HashMap<String, Object>();
         map.put("STARU_DATE", startDate);
         map.put("ENE_DATE", endDate);

         list.add(new MapRow(map));

         index += 3;
      }

      return list;
   }
1209342
public static Set<String> convertDataToSet(final Object data) {
		if (data == null) {
			return null;
		} else if (data instanceof Collection) {
			Collection items = (Collection) data;
			Set<String> set = new HashSet<>();
			for (Object item : items) {
				if (item != null) {
					set.add(item.toString());
				}
			}
			return set;
		} else if (data instanceof Object[]) {
			Object[] items = (Object[]) data;
			Set<String> set = new HashSet<>();
			for (Object item : items) {
				if (item != null) {
					set.add(item.toString());
				}
			}
			return set;
		} else {
			Set<String> set = new HashSet<>();
			set.add(data.toString());
			return set;
		}
	}
187521
public static <E> E[] asArray(List<E> input, E[] newArray) {
		return input.toArray(newArray);
	}
917101
public static byte[] newByteArray(byte[] data) {
        if (data == null) {
            throw new IllegalArgumentException("Data you want to copy are backed by null object.");
        }
        byte[] buffer = new byte[data.length];
        System.arraycopy(data, 0, buffer, 0, data.length);
        return buffer;
    }
417233
public static <T> JSONArray listToJSONArray(final List<T> list) {
        final JSONArray ret = new JSONArray();

        if (null == list) {
            return ret;
        }

        for (final T object : list) {
            ret.put(object);
        }

        return ret;
    }
227587
public static List<String> convertStringToList(String inputStr) {
        List<String> list = new ArrayList<String>();
        if (StringUtils.isNotBlank(inputStr)) {
            list = Arrays.asList(inputStr.split("\\|"));
        }
        return list;
    }