### Question:
GlobalOnline { public int getGlobalOnline() { return online; }  int getGlobalOnline(); void update();  }### Answer:
@Test public void getGlobalOnline() { GlobalOnlineRepository globalOnlineRepository = mock(GlobalOnlineRepository.class); when(globalOnlineRepository.getGlobalOnline()).thenReturn(10); GlobalOnline globalOnline = new GlobalOnline(globalOnlineRepository); globalOnline.update(); new Thread(() -> assertEquals(10, globalOnline.getGlobalOnline())).start(); }