PropertiesInvocationHandler implements InvocationHandler, Serializable { public Object invoke(Object proxy, Method invokedMethod, Object... args) throws Throwable { propertiesManager.syncReloadCheck(); if (isDefault(invokedMethod)) return invokeDefaultMethod(proxy, invokedMethod, args); DelegateMethodHandle delegate = getDelegateMethod(invokedMethod); if (delegate != null) return delegate.invoke(args); return resolveProperty(invokedMethod, args); } PropertiesInvocationHandler(PropertiesManager manager, Object jmxSupport); Object invoke(Object proxy, Method invokedMethod, Object... args); void setProxy(T proxy);  }
@Test public void testListPrintStream() throws Throwable { handler.invoke(proxy, MyConfig.class.getDeclaredMethod("list", PrintStream.class), printStream); verify(properties).list(eq(printStream)); }
@Test public void testListPrintWriter() throws Throwable { handler.invoke(proxy, MyConfig.class.getDeclaredMethod("list", PrintWriter.class), printWriter); verify(properties).list(eq(printWriter)); }