### Question:
Processor implements ExecutionListener { public synchronized boolean hasWork() { return !mEnqueuedWorkMap.isEmpty(); } Processor(
            Context appContext,
            Configuration configuration,
            WorkDatabase workDatabase,
            List<Scheduler> schedulers,
            Executor executor); synchronized boolean startWork(String id); synchronized boolean startWork(String id, Extras.RuntimeExtras runtimeExtras); synchronized boolean stopWork(String id); synchronized boolean stopAndCancelWork(String id); synchronized boolean isCancelled(String id); synchronized boolean hasWork(); synchronized boolean isEnqueued(@NonNull String workSpecId); synchronized void addExecutionListener(ExecutionListener executionListener); synchronized void removeExecutionListener(ExecutionListener executionListener); @Override synchronized void onExecuted(
            @NonNull String workSpecId,
            boolean isSuccessful,
            boolean needsReschedule);  }### Answer:
@Test @SmallTest public void testHasWork() { OneTimeWorkRequest work = new OneTimeWorkRequest.Builder(InfiniteTestWorker.class).build(); insertWork(work); assertThat(mProcessor.hasWork(), is(false)); mProcessor.startWork(work.getStringId()); assertThat(mProcessor.hasWork(), is(true)); }