static <T> T assertOne(Iterable<T> col) {
		Iterator<T> it = col.iterator();
		if (!it.hasNext()) {
			throw new AssertionError("Expected exactly one. Got none.");
		}
		T result = it.next();
		if (it.hasNext()) {
			List<T> all = new ArrayList<>();
			all.add(result);
			while (it.hasNext()) {
				all.add(it.next());
			}
			throw new AssertionError("Expected exactly one. Got many: " + all);
		}
		return result;
	}
Assert that exactly one element is in an iterable and get that element

@param <T> the type of element
@param col the iterable
@return the element
@throws AssertionError if no element or many elements exist in the iterable
Ghidra/Framework/Emulation/src/main/java/generic/Unique.java