### Question:
CallbackOnListener extends AbstractCallback { @Override public void performCallback(Object entity) { try { callbackMethod.invoke(listener, entity); } catch (Exception e) { throw new CayenneRuntimeException( "Error invoking entity listener callback method " + callbackMethod.getName(), e); } } CallbackOnListener(Object listener, String methodName);   CallbackOnListener(Object listener, String methodName, Class<?> entityType);   CallbackOnListener(Object listener, Method method, Class<?> entityType); @Override void performCallback(Object entity); @Override String toString();  }### Answer:
@Test public void testPublicCallbackMethod() { MockCallingBackListener listener = new MockCallingBackListener(); CallbackOnListener callback = new CallbackOnListener( listener, "publicCallback", Object.class); MockCallingBackEntity e = new MockCallingBackEntity(); callback.performCallback(e); assertFalse(e.publicCallbackInvoked); assertFalse(e.protectedCallbackInvoked); assertFalse(e.privateCallbackInvoked); assertFalse(e.defaultCallbackInvoked); assertSame(e, listener.getPublicCalledbackEntity()); }