### Question:
Schedulers { static @NonNull Scheduler createBestAvailableBackgroundScheduler( @NonNull Context context, @NonNull WorkManagerImpl workManager) { Scheduler scheduler; boolean enableFirebaseJobService = false; boolean enableSystemAlarmService = false; if (Build.VERSION.SDK_INT >= WorkManagerImpl.MIN_JOB_SCHEDULER_API_LEVEL) { scheduler = new SystemJobScheduler(context, workManager); setComponentEnabled(context, SystemJobService.class, true); Log.d(TAG, "Created SystemJobScheduler and enabled SystemJobService"); } else { try { scheduler = tryCreateFirebaseJobScheduler(context); enableFirebaseJobService = true; Log.d(TAG, "Created FirebaseJobScheduler"); } catch (Exception e) { scheduler = new SystemAlarmScheduler(context); enableSystemAlarmService = true; Log.d(TAG, "Created SystemAlarmScheduler"); } } try { Class firebaseJobServiceClass = Class.forName(FIREBASE_JOB_SERVICE_CLASSNAME); setComponentEnabled(context, firebaseJobServiceClass, enableFirebaseJobService); } catch (ClassNotFoundException e) { } setComponentEnabled(context, SystemAlarmService.class, enableSystemAlarmService); return scheduler; } private  Schedulers(); static void schedule(
            @NonNull Configuration configuration,
            @NonNull WorkDatabase workDatabase,
            List<Scheduler> schedulers);  }### Answer:
@Test @SdkSuppress(minSdkVersion = WorkManagerImpl.MIN_JOB_SCHEDULER_API_LEVEL) public void testGetBackgroundScheduler_withJobSchedulerApiLevel() { Scheduler scheduler = Schedulers.createBestAvailableBackgroundScheduler(mAppContext, mWorkManager); assertThat(scheduler, is(instanceOf(SystemJobScheduler.class))); assertServicesEnabled(true, false, false); }
@Test @SdkSuppress(maxSdkVersion = WorkManagerImpl.MAX_PRE_JOB_SCHEDULER_API_LEVEL) public void testGetBackgroundScheduler_beforeJobSchedulerApiLevel() { Scheduler scheduler = Schedulers.createBestAvailableBackgroundScheduler(mAppContext, mWorkManager); assertThat(scheduler, is(instanceOf(SystemAlarmScheduler.class))); assertServicesEnabled(false, false, true); }