mil.dod.th.ose.test/src/mil/dod/th/ose/test/EventAdminMocker.java
@SuppressWarnings({"unchecked", "rawtypes"})
    public static EventHandlerRegistrationAnswer stubHandlerOfType(
            final BundleContext context, Class<? extends EventHandler> clazz, EventAdmin admin)
    {
        ServiceRegistration reg = mock(ServiceRegistration.class);
        
        EventHandlerRegistrationAnswer answer = new EventHandlerRegistrationAnswer(reg, admin);
        
        doAnswer(answer).when(context).registerService(eq(EventHandler.class), 
                Mockito.any(clazz), Mockito.any(Dictionary.class));
        
        return answer;
    }
/**
     * Method to mock the {@link BundleContext#registerService(Class, Object, Dictionary)}
     * and retrieve the event handler that was registered in that call.
     * @param context
     *  the bundle context to use
     * @param clazz
     *  the event handler class of the handler that is being registered
     * @param admin
     *  the event admin instance to use
     * 
     * @return
     *  the event handler that is returned
     */
Method to mock the  BundleContext#registerService(Class, Object, Dictionary)
and retrieve the event handler that was registered in that call.
@param context
the bundle context to use
@param clazz
the event handler class of the handler that is being registered
@param admin
the event admin instance to use

@return
the event handler that is returned
Method to mock the BundleContext#registerService ( Class Object Dictionary ) and retrieve the event handler that was registered in that call . @param context the bundle context to use @param clazz the event handler class of the handler that is being registered @param admin the event admin instance to use @return the event handler that is returned
@SuppressWarnings({"unchecked", "rawtypes"})
    public static EventHandlerRegistrationAnswer stubHandlerOfType(
            final BundleContext context, Class<? extends EventHandler> clazz, EventAdmin admin)
    {
        ServiceRegistration reg = mock(ServiceRegistration.class);
        EventHandlerRegistrationAnswer answer = new EventHandlerRegistrationAnswer(reg, admin);
        doAnswer(answer).when(context).registerService(eq(EventHandler.class), 
                Mockito.any(clazz), Mockito.any(Dictionary.class));
        return answer;
    }
@ SuppressWarnings ( { "unchecked" , "rawtypes" } ) public static EventHandlerRegistrationAnswer stubHandlerOfType ( final BundleContext context , Class < ? extends EventHandler > clazz , EventAdmin admin ) { ServiceRegistration reg = mock ( ServiceRegistration . class ) ; EventHandlerRegistrationAnswer answer = new EventHandlerRegistrationAnswer ( reg , admin ) ; doAnswer ( answer ) . when ( context ) . registerService ( eq ( EventHandler . class ) , Mockito . any ( clazz ) , Mockito . any ( Dictionary . class ) ) ; return answer ; }
Method to mock the {@link BundleContext#registerService(Class, Object, Dictionary)}
 and retrieve the event handler that was registered in that call.
Method to mock the { @link BundleContext#registerService ( Class Object Dictionary ) } and retrieve the event handler that was registered in that call .