public static <T> List<T> extendList(List<T> list, T ext) {
		@SuppressWarnings("unchecked")
		T[] arr = (T[]) new Object[list.size() + 1];
		list.toArray(arr);
		arr[list.size()] = ext;
		return List.of(arr);
	}
Extend a list with the given item

<p>
Used in functional style when the list is immutable.

@param <T> the type of elements
@param list the list
@param ext the additional item
@return an immutable copy of the list with the given item appended
Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/app/plugin/assembler/sleigh/util/AsmUtil.java