Normalize an array to a certain length

@param list      TODO
@param minlength TODO
@return TODO
183230
private String[] normalize( String[] list, int minlength )
    {
        if ( list.length < minlength )
        {
            // Need to do padding
            String[] newlist = new String[minlength];
            System.arraycopy( list, 0, newlist, 0, list.length );
            Arrays.fill( newlist, list.length, newlist.length, "0" );
            return newlist;
        }
        else
        {
            return list;
        }
    }
41408
public static <T> T[] toArray(List<T> list) {
        T[] toR = (T[]) Array.newInstance(list.get(0).getClass(), list.size());
        for (int i = 0; i < list.size(); i++) {
            toR[i] = list.get(i);
        }
        return toR;
    }
952036
public static int len(String list, char delimiter, boolean ignoreEmpty) {
	int len = StringUtil.length(list);
	if (len == 0) return 0;

	int count = 0;
	int last = 0;

	for (int i = 0; i < len; i++) {
	    if (list.charAt(i) == delimiter) {
		if (!ignoreEmpty || last < i) count++;
		last = i + 1;
	    }
	}
	if (!ignoreEmpty || last < len) count++;
	return count;
    }
1024843
public static int[] listToMap(int[] list) {
        list = pad(list);
        int[] bitMap = new int[(int)(list.length / WORD_LENGTH)];
        Arrays.fill(bitMap, 0);
        int j = -1;
        for (int i = 0; i < list.length; i++) {
            if (i % WORD_LENGTH == 0) {
                j++;
            }
            bitMap[j] |= (list[i] << ((WORD_LENGTH - 1) - (i % WORD_LENGTH)));
        }
        return bitMap;
    }
574428
private static List<Integer> convertList(List<String> list) {
        if (list == null) {
            return null;
        }
        List<Integer> ret = new ArrayList<Integer>(list.size());
        for (String v : list) {
            ret.add(StringUtils.toInt(v));
        }

        return ret;
    }
1041827
public String randomLowerMaxLength(int minLength, int maxLength) {
        int range = maxLength - minLength;
        int randomLength = 0;
        if (range > 0) {
            randomLength = random(range);
        }
        return randomLower(minLength + randomLength);
    }
102456
function min(array) {
  var length = array.length;

  if (length === 0) {
    return 0;
  }

  var index = -1;
  var result = array[++index];

  while (++index < length) {
    if (array[index] < result) {
      result = array[index];
    }
  }

  return result;
}
874634
private List<String> listToLowerCase(List<String> l)
	{
		List<String> result = new ArrayList<String>();
		for (String s : l)
		{
			result.add(s.toLowerCase());
		}
		return result;
	}
551596
function normalizeLength(token, length) {
	length = length || 6;
	if (token.length < length) {
		token += (new Array(length - token.length + 1)).join('0');
	}
    return token.slice(0, length);
}
531233
function (list) {
		var items = [];
		var i = 0;
		var listLength = list.length;

		for (; i < listLength; i++) {
			items.push(list[i]);
		}

		return items;
	}
661029
def _validate_minlength(self, min_length, field, value):
        
        if isinstance(value, Iterable) and len(value) < min_length:
            self._error(field, errors.MIN_LENGTH, len(value))
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;
    }
775214
public static <T> List<T> minList (Iterable<T> iterable, Comparator<? super T> comp)
    {
        return maxList(iterable, java.util.Collections.reverseOrder(comp));
    }
658360
public static Array listToArrayRemoveEmpty(String list, char delimiter) {
	int len = list.length();
	ArrayImpl array = new ArrayImpl();
	if (len == 0) return array;
	int last = 0;

	for (int i = 0; i < len; i++) {
	    if (list.charAt(i) == delimiter) {
		if (last < i) array.appendEL(list.substring(last, i));
		last = i + 1;
	    }
	}
	if (last < len) array.appendEL(list.substring(last));

	return array;
    }
307871
public static long min(long... numberArray) {
		if (isEmpty(numberArray)) {
			throw new IllegalArgumentException("Number array must not empty !");
		}
		long min = numberArray[0];
		for (int i = 0; i < numberArray.length; i++) {
			if (min > numberArray[i]) {
				min = numberArray[i];
			}
		}
		return min;
	}
736804
public static PactDslJsonArray arrayMinLike(int minSize, int numberExamples, PactDslJsonRootValue value) {
    if (numberExamples < minSize) {
      throw new IllegalArgumentException(String.format("Number of example %d is less than the minimum size of %d",
        numberExamples, minSize));
    }
    PactDslJsonArray parent = new PactDslJsonArray("", "", null, true);
    parent.setNumberExamples(numberExamples);
    parent.matchers.addRule("", parent.matchMin(minSize));
    parent.putObject(value);
    return parent;
  }
702055
private static String formatListToString(final List<String> list)
	{
		int lineLength = 0;
		final StringBuffer sb = new StringBuffer();
		for (final String str : list)
		{
			final int length = str.length();
			lineLength = length + lineLength;
			sb.append(str);
			sb.append(", ");
			if (100 < lineLength)
			{
				sb.append("\n");
				lineLength = 0;
			}
		}
		return sb.toString().trim();
	}