* @param fieldType
* the type of the field
*/
@SuppressWarnings("unchecked")
public static <T> T getInternalState(Object object, Class<T> fieldType) {
Field foundField = findFieldInHierarchy(object, new FieldTypeMatcherStrategy(fieldType));
try {
return (T) foundField.get(object);
} catch (IllegalAccessException e) {
throw new RuntimeException("Internal error: Failed to get field in method getInternalState.", e);
}