Can I redefine private methods using Byte Buddy?
Is it possible to use Byte Buddy to redefine a private method of a class? It seems that the entry point into using Byte Buddy is always sub-classing an existing class. When doing this, it is obviously not possible to redefine a private method of the parent class (at least not in a way that the redefined method is used in the parent class). Consider the following example: public class Foo { public void sayHello() { System.out.println(getHello()); } private String getHello() { return "Hello World!"; } } Foo foo = new ByteBuddy() .subclass(Foo.class) .method(named("getHello")).intercept