NannyRequest { protected void stop(Context context) { if (mReceiver != null) { context.unregisterReceiver(mReceiver); } } NannyRequest();   }
@Test public void stop() throws Exception { when(Nanny.isPermissionNannyInstalled(mContext)).thenReturn(true); mNannyRequest.addFilter(mEvent); mNannyRequest.setPayload(mIntent); mNannyRequest.startRequest(mContext); mNannyRequest.stop(mContext); verify(mContext).unregisterReceiver((BroadcastReceiver) notNull()); }