### Question:
ChatRepository { public LiveData<PagedList<ChatMessage>> getMessagesByGroupId(int groupId) { return new LivePagedListBuilder<>(chatDao.getMessagesByGroupId(groupId), 30).build(); } ChatRepository(ChatDao chatDao, RequestEncoder encoder,
                          Handler backgroundHandler); void addMessage(ChatMessage message); LiveData<PagedList<ChatMessage>> getMessagesByGroupId(int groupId); void requestSendMessage(int groupId, String message); void deleteAllMessages();  }### Answer:
@Test public void getMessagesTest() { when(mockChatDao.getMessagesByGroupId(mockGroupId)) .thenReturn(() -> { return null; }); testChatRepository.getMessagesByGroupId(mockGroupId); verify(mockChatDao).getMessagesByGroupId(mockGroupId); }