PagerDuty extends ServiceImpl implements CrashReportingService { PagerDutyService createService(){ if(pagerDutyService == null) { RestAdapter restAdapter = new RestAdapter.Builder() .setEndpoint("https: .build(); pagerDutyService = restAdapter.create(PagerDutyService.class); } return pagerDutyService; } PagerDuty(Context context); void enable(String apiKey); boolean isEnabled(); @Override ServiceType getServiceType(); void logEvent(StoredException storedException, Callback<Object> callback);  }
@Test public void testCreateService() { PagerDuty pagerDuty = new PagerDuty(null); assertNull(pagerDuty.pagerDutyService); pagerDuty.createService(); assertNotNull(pagerDuty.pagerDutyService); PagerDuty.PagerDutyService service = pagerDuty.pagerDutyService; pagerDuty.createService(); assertSame(service, pagerDuty.pagerDutyService); }