### Question:
RemotePresenter { public void onInstanceUpdate( @Observes final ServerInstanceUpdated serverInstanceUpdated ) { if ( serverInstanceUpdated != null && serverInstanceUpdated.getServerInstance() != null ) { final ServerInstanceKey updatedServerInstanceKey = toKey( serverInstanceUpdated.getServerInstance() ); if ( serverInstanceKey != null && serverInstanceKey.getServerInstanceId().equals( updatedServerInstanceKey.getServerInstanceId() ) ) { serverInstanceKey = updatedServerInstanceKey; loadContent( serverInstanceUpdated.getServerInstance().getContainers() ); } } else { logger.warn( "Illegal event argument." ); } } @Inject  RemotePresenter( final Logger logger,
                            final View view,
                            final RemoteStatusPresenter remoteStatusPresenter,
                            final RemoteEmptyPresenter remoteEmptyPresenter,
                            final Caller<RuntimeManagementService> runtimeManagementService,
                            final Caller<SpecManagementService> specManagementServiceCaller,
                            final Event<NotificationEvent> notification ); @PostConstruct void init(); View getView(); void onSelect( @Observes final ServerInstanceSelected serverInstanceSelected ); void onInstanceUpdate( @Observes final ServerInstanceUpdated serverInstanceUpdated ); void remove(); void refresh(); void load( final ServerInstanceKey serverInstanceKey );  }### Answer:
@Test public void testOnInstanceUpdate() { final ServerInstance serverInstance = new ServerInstance( "templateId", "serverName", "serverInstanceId", "url", "1.0", Collections.<Message>emptyList(), Collections.<Container>emptyList() ); presenter.onSelect( new ServerInstanceSelected( serverInstance ) ); presenter.onInstanceUpdate( new ServerInstanceUpdated( serverInstance ) ); verify( view, times( 2 ) ).clear(); verify( view, times( 2 ) ).setServerName( serverInstance.getServerName() ); verify( view, times( 2 ) ).setServerURL( serverInstance.getUrl() ); verify( view, times( 2 ) ).setEmptyView( remoteEmptyPresenter.getView() ); }
@Test public void testOnInstanceUpdateWithoutSelect() { final ServerInstance serverInstance = new ServerInstance( "templateId", "serverName", "serverInstanceId", "url", "1.0", Collections.<Message>emptyList(), Collections.<Container>emptyList() ); presenter.onInstanceUpdate( new ServerInstanceUpdated( serverInstance ) ); verify( view, never() ).clear(); verify( view, never() ).setServerName( anyString() ); verify( view, never() ).setServerURL( anyString() ); verify( view, never() ).setEmptyView( any(RemoteEmptyView.class) ); }