public void testAddRemoveListener() {
   TestCountryDetector countryDetector = new TestCountryDetector();
   CountryListenerImpl listener = new CountryListenerImpl();
   countryDetector.setCountryListener(listener);
   assertTrue(countryDetector.isPhoneStateListenerAdded());
   assertTrue(countryDetector.locationBasedDetectorStarted());
   countryDetector.setCountryListener(null);
   assertFalse(countryDetector.isPhoneStateListenerAdded());
   assertTrue(countryDetector.locationBasedDetectorStopped());
 }
 public void testGeocoderNotImplemented() {
   TestCountryDetector countryDetector =
       new TestCountryDetector() {
         @Override
         protected boolean isGeoCoderImplemented() {
           return false;
         }
       };
   CountryListenerImpl listener = new CountryListenerImpl();
   countryDetector.setCountryListener(listener);
   assertTrue(countryDetector.isPhoneStateListenerAdded());
   assertFalse(countryDetector.locationBasedDetectorStarted());
   countryDetector.setCountryListener(null);
   assertFalse(countryDetector.isPhoneStateListenerAdded());
 }