public static List<Object> getAllInstanceFields(Object ownerInstance) {
		if (ownerInstance == null) {
			throw new NullPointerException("Owner of instance field cannot be null");
		}

		Class<?> objectClass =
			(ownerInstance instanceof Class) ? (Class<?>) ownerInstance : ownerInstance.getClass();
		List<Object> results = new ArrayList<>();

		Field[] fields = objectClass.getDeclaredFields();
		for (Field field : fields) {
			field.setAccessible(true);
			try {
				Object fieldInstance = field.get(ownerInstance);
				results.add(fieldInstance);
			}
			catch (Exception e) {
				throw new RuntimeException(
					"Unable to use reflection to obtain fields from class: " + objectClass, e);
			}
		}

		return results;
	}
Gets all fields of the given object.  Only objects on the immediate instance are 
returned.

@param ownerInstance the object from which to get fields
@return the fields
Ghidra/Framework/Generic/src/main/java/generic/test/TestUtils.java