CommandProcessor implements RestProcessor { public void removeListener( HeartbeatListener listener ) { if ( listener != null ) { listeners.remove( listener ); } } CommandProcessor( final HostRegistry hostRegistry, final IdentityManager identityManager ); void addListener( HeartbeatListener listener ); void removeListener( HeartbeatListener listener ); void dispose(); @Override void handleHeartbeat( final HeartBeat heartBeat ); @Override Set<String> getRequests( final String hostId ); @Override void handleResponse( final Response response );  }
@Test public void removeListener() throws Exception { commandProcessor.removeListener( heartbeatListener ); verify( listeners ).remove( heartbeatListener ); }