EventBus { public synchronized EventBus unsubscribe(final String endPoint, final Actor actor) { checkActorIsValid(actor); checkEndPointIsValid(endPoint); final String trimmedEndPoint = endPoint.trim(); if (endPointsAndActorsMapping.containsKey(trimmedEndPoint)) { endPointsAndActorsMapping.get(trimmedEndPoint).remove(actor); } return this; } private  EventBus(); static synchronized EventBus getInstance(); synchronized EventBus subscribe(final String endPoint, final Actor actor); synchronized EventBus unsubscribe(final String endPoint, final Actor actor); synchronized EventBus removeEndpoint(final String endPoint); void broadcast(final String endPoint, final Object message);  }
@Test public void unSubscribe() throws InterruptedException { EventBus.getInstance().unsubscribe(ENDPOINT_1, SUPPORT_MESSAGE_ACTOR_1); EventBus.getInstance().broadcast(ENDPOINT_1, "Test"); Thread.sleep(10); assertFalse(SUPPORT_MESSAGE_ACTOR_1.gotMessage); }