@Test public void anonymous() {
    final AtomicReference<String> holder = new AtomicReference<String>();
    final AtomicInteger deliveries = new AtomicInteger();
    Bus bus = new Bus(ThreadEnforcer.ANY);
    bus.register(new Object() {
      @Subscribe
      public void accept(String str) {
        holder.set(str);
        deliveries.incrementAndGet();
      }
    });

    String EVENT = "Hello!";
    bus.post(EVENT);

    assertEquals("Only one event should be delivered.", 1, deliveries.get());
    assertEquals("Correct string should be delivered.", EVENT, holder.get());
  }
Test cases for {@code Bus} that must not be in the same package.

@author Louis Wasserman
otto/src/test/java/com/squareup/otto/outside/OutsideEventBusTest.java