@Test public void subscribingOrProducingOnlyAllowedOnPublicMethods() {
    try {
      bus.register(new Object() {
        @Subscribe protected void method(Object o) {}
      });
      fail();
    } catch (IllegalArgumentException expected) {
      // Expected.
    }
    try {
      bus.register(new Object() {
        @Subscribe void method(Object o) {}
      });
      fail();
    } catch (IllegalArgumentException expected) {
    }
    try {
      bus.register(new Object() {
        @Subscribe private void method(Object o) {}
      });
      fail();
    } catch (IllegalArgumentException expected) {
    }
    try {
      bus.register(new Object() {
        @Produce protected Object method() { return null; }
      });
      fail();
    } catch (IllegalArgumentException expected) {
    }
    try {
      bus.register(new Object() {
        @Produce Object method() { return null; }
      });
      fail();
    } catch (IllegalArgumentException expected) {
    }
    try {
      bus.register(new Object() {
        @Produce private Object method() { return null; }
      });
      fail();
    } catch (IllegalArgumentException expected) {
    }
  }
Tests that events are distributed to any subscribers to their type or any
supertype, including interfaces and superclasses.

Also checks delivery ordering in such cases.
otto/src/test/java/com/squareup/otto/BusTest.java