@SuppressWarnings("unchecked")
	public synchronized static <T> int indexOf(T array[], T search) {
		if (array == null || array.length == 0) {
			return -1;
		}

		if (search == null) {
			for (int i = 0; i < array.length; ++i) {
				if (array[i] == null) {
					return i;
				}
			}
		} else {
			for (int i = 0; i < array.length; ++i) {
				if (array[i] != null && search.equals(array[i])) {
					return i;
				}
			}
		}
		return -1;
	}