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

		Object seed = list.get(0);
		LinkedHashSet<Class<?>> master = 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());
			master.retainAll(next);
		}

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

		return master;
	}
Returns an ordered set of parent 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