BaseInvocationHandler implements InvocationHandler { protected abstract Object invokeInternal(Object proxy, Method method, Object[] arguments) throws Throwable;  @Override Object invoke(Object proxy, Method method, Object[] arguments);  }
@Test public void testInvokeInternal() { MyClass myClass = new MyClass(); Assert.assertEquals("myMethod", myClass.myMethod()); MyInterface proxy = (MyInterface)Proxy.newProxyInstance(getClass().getClassLoader(), new Class[] { MyInterface.class }, new TestInvocationHandler()); Assert.assertEquals("This is only a test", proxy.myMethod()); }