### Question:
ScopedEventBus implements EventBus, Serializable { @Override public <T> void subscribeWithWeakReference(EventBusListener<T> listener) { subscribeWithWeakReference(listener, true); } ScopedEventBus(EventScope scope);  ScopedEventBus(EventScope scope, EventBus parentEventBus); @Override EventScope getScope(); @Override void publish(Object sender, T payload); @Override void publish(String topic, Object sender, T payload); @Override void publish(EventScope scope, Object sender, T payload); @Override void publish(EventScope scope, String topic, Object sender, T payload); @Override void subscribe(EventBusListener<T> listener); @Override void subscribeWithWeakReference(EventBusListener<T> listener); @Override void subscribe(EventBusListener<T> listener, String topic); @Override void subscribe(EventBusListener<T> listener, boolean includingPropagatingEvents); @Override void subscribeWithWeakReference(EventBusListener<T> listener, String topic); @Override void subscribeWithWeakReference(EventBusListener<T> listener, boolean includingPropagatingEvents); @Override void subscribe(Object listener); @Override void subscribe(Object listener, String topic); @Override void subscribeWithWeakReference(Object listener, String topic); @Override void subscribeWithWeakReference(Object listener); @Override void subscribe(Object listener, boolean includingPropagatingEvents); @Override void subscribeWithWeakReference(Object listener, boolean includingPropagatingEvents); @Override void unsubscribe(EventBusListener<T> listener); @Override void unsubscribe(final Object listener); @Override String toString();  }### Answer:
@Test public void testSubscribeWithWeakReference() { StringListener listener = new StringListener() { int cnt = 0; @Override public void onEvent(Event<String> event) { cnt++; if (cnt > 1) { fail("I should have been garbage collected by now"); } } }; applicationEventBus.subscribeWithWeakReference(listener); applicationEventBus.publish(this, "Hello World Application"); listener = null; System.gc(); applicationEventBus.publish(this, "Hello World Application"); }