implemented onInstance(Object) and onReturn(Class)