### Question:
EventBridge implements EventListener { protected abstract void sendExternalEvent(CayenneEvent localEvent) throws Exception; EventBridge(EventSubject localSubject, String externalSubject);  EventBridge(Collection<EventSubject> localSubjects, String externalSubject); static String convertToExternalSubject(EventSubject localSubject); String getExternalSubject(); boolean isRunning(); Collection<EventSubject> getLocalSubjects(); EventManager getEventManager(); Object getExternalEventSource(); boolean receivesLocalEvents(); boolean receivesExternalEvents(); void startup(EventManager eventManager, int mode); void startup(EventManager eventManager, int mode, Object localEventSource); void startup(
            EventManager eventManager,
            int mode,
            Object localEventSource,
            Object remoteEventSource); void shutdown(); static final int RECEIVE_LOCAL; static final int RECEIVE_EXTERNAL; static final int RECEIVE_LOCAL_EXTERNAL; }### Answer:
@Test public void testSendExternalEvent() throws Exception { final EventSubject local = EventSubject.getSubject( EventBridgeTest.class, "testInstall"); String external = "externalSubject"; final TestBridge bridge = new TestBridge(local, external); DefaultEventManager manager = new DefaultEventManager(2); managersToClean.add(manager); bridge.startup(manager, EventBridge.RECEIVE_LOCAL_EXTERNAL); final SnapshotEvent eventWithNoSubject = new SnapshotEvent( this, this, null, null, null, null); manager.postEvent(eventWithNoSubject, local); ParallelTestContainer helper = new ParallelTestContainer() { @Override protected void assertResult() throws Exception { assertTrue(bridge.lastLocalEvent instanceof SnapshotEvent); assertEquals(local, bridge.lastLocalEvent.getSubject()); } }; helper.runTest(5000); final SnapshotEvent eventWithSubject = new SnapshotEvent( this, this, null, null, null, null); eventWithSubject.setSubject(local); manager.postEvent(eventWithNoSubject, local); ParallelTestContainer helper1 = new ParallelTestContainer() { @Override protected void assertResult() throws Exception { assertTrue(bridge.lastLocalEvent instanceof SnapshotEvent); assertEquals(local, bridge.lastLocalEvent.getSubject()); } }; helper1.runTest(5000); }