### Question:
MyClass1 { public String nonStaticHello(String arg) { return "NonStatic Hello " + arg; }  String nonStaticHello(String arg); String goodByeWrapper(String arg);  }### Answer:
@Test public void testReplacingNonStaticMethod() throws Exception { replace(method(MyClass1.class, "nonStaticHello")).with( new InvocationHandler() { public Object invoke(Object object, Method method, Object[] arguments) throws Throwable { if (arguments[0].equals("Frank")) { return "NonStatic Hello John, you are awesome!"; } else { return method.invoke(object, arguments); } } }); assertEquals("NonStatic Hello Someone", new MyClass1().nonStaticHello("Someone")); assertEquals("NonStatic Hello John, you are awesome!", new MyClass1().nonStaticHello("Frank")); }