@Test
@SuppressWarnings( "unchecked" )
public void testUnregister_withRegistration_withException() {

	IMessagingClient messagingClient = Mockito.mock( IMessagingClient.class );
	JmxWrapperForMessagingClient client = new JmxWrapperForMessagingClient( messagingClient );
	ServiceRegistration<MessagingApiMBean> serviceReg = Mockito.mock( ServiceRegistration.class );
	Mockito.doThrow( new RuntimeException( "for test" )).when( serviceReg ).unregister();
	client.serviceReg = serviceReg;
	client.unregisterService();
	Assert.assertNull( client.serviceReg );
	Mockito.verify( serviceReg, Mockito.only()).unregister();
}