public static LinkedHashSet<Class<?>> getSharedHierarchy(List<?> list) {

		Object seed = list.get(0);

		LinkedHashSet<Class<?>> master = new LinkedHashSet<>();
		Class<?> start = seed.getClass();
		boolean shareType = list.stream().allMatch(t -> t.getClass().equals(start));
		if (shareType) {
			master.add(start);
		}

		LinkedHashSet<Class<?>> parents = getAllParents(seed.getClass());

		Iterator<?> iterator = list.iterator();
		iterator.next(); // we already grabbed the seed
		while (iterator.hasNext()) {
			Object o = iterator.next();
			LinkedHashSet<Class<?>> next = getAllParents(o.getClass());
			parents.retainAll(next);
		}

		master.addAll(parents);

		if (master.isEmpty()) {
			master.add(Object.class);
		}

		return master;
	}
Returns an ordered set of interfaces and classes that are shared amongst the items in
the list.
<p>
The order of the items is as they are first encountered, favoring interfaces before
classes.  Further, interface hierarchies are examined before concrete parent extensions.
<p>
If the given items have no parents in common, then the result will be a list with
only <code>Object.class</code>.

@param list the items to examine
@return the set of items
Ghidra/Framework/Utility/src/main/java/utilities/util/reflection/ReflectionUtilities.java