LogListener { protected void processNewLogs() { List<String> logs = getNewLogs(); processLogEntries(logs); utils.sleep(pollFrequencyMs); } LogListener(Context context, List<LoggingService> services, boolean wifiOnly); void start();  }
@Test public void testProcessNewLogs() { LogListener logListener = mock(LogListener.class); logListener.utils = UnitTestUtils.mockUtils(); doCallRealMethod().when(logListener).processNewLogs(); logListener.processNewLogs(); verify(logListener).getNewLogs(); verify(logListener).processNewLogs(); }