title: Testing Android Activity with Robolectric, duplicated Otto provider
body: <p>I have a little problem figuring out how to test my Activity using Robolectric 2.2. I am probably not correctly setting up the lifecycle or the entire test...</p>
  
  <p>In my Activity, I have a Otto producer like this:</p>
  
  <pre><code>@Produce public GetAlarmList produceAlarmList() {
      Log.v(this, "Producing GetAlarmList event.");
      return new GetAlarmList(mAlarmList);
  }
  </code></pre>
  
  <p>The following is my test.</p>
  
  <pre><code>@RunWith(RobolectricTestRunner.class)
  public class GLarmListFragmentTests {
  
      //GLarmMain mActivity;
      ActivityController&lt;GLarmMain&gt; mController;
  
      @Before
      public void setUp() throws Exception {
          mController = Robolectric.buildActivity(GLarmMain.class);
      }
  
      @After
      public void tearDown() throws Exception {
          mController = mController.destroy();
      }
  
      @Test
      public void shouldHaveListFragment() {
          GLarmMain activity = mController.create().start().resume().visible().get();
          GLarmListFragment listFragment = (GLarmListFragment) activity.getSupportFragmentManager().findFragmentById(R.id.main_list_frag);
          assertNotNull(listFragment);
      }
  
      @Test
      public void shouldHaveListAdapter() {
          GLarmMain activity = mController.create().start().resume().visible().get();
          GLarmListFragment listFragment = (GLarmListFragment) activity.getSupportFragmentManager().findFragmentById(R.id.main_list_frag);
          FuncAlarmListAdapter listAdapter = (FuncAlarmListAdapter)listFragment.getListAdapter(); 
          assertNotNull(listAdapter);
      }
  }
  </code></pre>
  
  <p>Every time I launch it, I receive:</p>
  
  <pre><code>java.lang.IllegalArgumentException: Producer method for type class ar.android.app.glarm.events.GetAlarmList found on type class ar.android.app.glarm.ui.GLarmMain, but already registered by type class ar.android.app.glarm.ui.GLarmMain.
      at com.squareup.otto.Bus.register(Bus.java:198)
      at ar.android.app.glarm.ui.GLarmMain.onResume(GLarmMain.java:461)
      at android.app.Instrumentation.callActivityOnResume(Instrumentation.java:1184)
      at android.app.Activity.performResume(Activity.java:5082)
      at org.fest.reflect.method.Invoker.invoke(Invoker.java:112)
      at org.robolectric.util.ActivityController$6.run(ActivityController.java:216)
      at org.robolectric.shadows.ShadowLooper.runPaused(ShadowLooper.java:256)
      at org.robolectric.util.ActivityController.invokeWhilePaused(ActivityController.java:214)
      at org.robolectric.util.ActivityController.resume(ActivityController.java:152)
      at ar.android.app.glarm.test.GLarmListFragmentTests.shouldHaveListAdapter(GLarmListFragmentTests.java:51)
  </code></pre>
  
  <p>Does someone have the same issue? How can I solve it?</p>