private static Class<?> getClass(Type type) {

		if (type instanceof Class) {
			return (Class<?>) type;
		}

		if (type instanceof ParameterizedType) {
			return getClass(((ParameterizedType) type).getRawType());
		}

		if (type instanceof GenericArrayType) {
			GenericArrayType arrayType = (GenericArrayType) type;
			Type componentType = arrayType.getGenericComponentType();
			Class<?> componentClass = getClass(componentType);
			if (componentClass != null) {
				return Array.newInstance(componentClass, 0).getClass();
			}
			return null;
		}

		return null;
	}
Returns the type arguments for the given base class and extension.

<p>Caveat: this lookup will only work if the given child class is a concrete class that
has its type arguments specified.  For example, these cases will work:
<pre>
		// anonymous class definition
		List&lt;String&gt; myList = new ArrayList&lt;String&gt;() {
			...
		};

		// class definition
		public class MyList implements List&lt;String&gt; {
</pre>

Whereas this case will not work:
<pre>
		// local variable with the type specified
		List&lt;String&gt; myList = new ArrayList&lt;String&gt;();
</pre>

<p>Note: a null entry in the result list will exist for any type that was unrecoverable


@param <T> the type of the base and child class
@param baseClass the base class
@param childClass the child class
@return the type arguments
Ghidra/Framework/Utility/src/main/java/utilities/util/reflection/ReflectionUtilities.java