How about to provide one more method - `List<Message<?>> getMessagesForGroup(Object groupId)` ?