A method of instrumenting a method of a class by modifying bytecodes is
disclosed. The method comprises: providing an interface, by which the
method can be selected; inserting bytecodes that will be executed when
the selected method is called; and providing an interface, through the
inserted bytecodes can pass information about the method.