protected final void transform(Recorder recorder,
								   PyReflectedFunction target,
								   Object instance)
		throws NonInstrumentableTypeException {

		final List<Method> reflectedArguments = extractJavaMethods(target);

		if (instance != null) {
			for (Method m : reflectedArguments) {

				Class<?> c = instance.getClass();

				// We want the instance's implementation, not the interface or
				// superclass method used by the call site.
				do {
					try {
						getContext().add(instance,
							c.getDeclaredMethod(m.getName(),
								m.getParameterTypes()),
							TargetSource.FIRST_PARAMETER,
							recorder);
						break;
					}
					catch (NoSuchMethodException e) {
						c = c.getSuperclass();
					}
				}
				while (c != null);
			}
		}
		else {
			for (Method m : reflectedArguments) {
				getContext().add(m.getDeclaringClass(),
					m,
					TargetSource.CLASS, recorder);
			}
		}
	}
Extract and instrument the underlying Java methods for instrumentation.

@param <T>
         Constructor<?> or Method
@param pyReflectedFunction
         The Jython object.
@return A list of Java methods or constructors.
@throws NonInstrumentableTypeException
          If the methods could not be extracted.
ngrinder-runtime/src/main/java/net/grinder/scriptengine/jython/instrumentation/dcr/AbstractJythonDCRInstrumenter.java