source: class LaunchAnalyzerReceiverTest {
  
      private static final String ACTION;
  
      @Test
      public void onReceive() throws Exception {
  
target: 
          //one
          ShadowApplication application = ShadowApplication.getInstance();
          Intent intent = new Intent(ACTION);
          boolean result = application.hasReceiverForIntent(intent);
          assertTrue(result);
  
          //only one
          List<BroadcastReceiver> receivers = application.getReceiversForIntent(intent);
          assertEquals(1,receivers.size());
  
          //test onReceive
          intent.putExtra("c","off");
          BroadcastReceiver targetReceiver = receivers.get(0);
          targetReceiver.onReceive(application.getApplicationContext(),intent);
  
          Intent serviceIntent = application.getNextStoppedService();
          assertEquals(serviceIntent.getComponent().getClassName(),AnalyzerService.class.getCanonicalName());
      }
  
  }