code: public List<ChatMessage> adaptMessages(List<MessageReceived> messagesReceived) {
  
          List<ChatMessage> chatMessages = new ArrayList<>();
  
          if (messagesReceived != null) {
              for (MessageReceived msg : messagesReceived) {
  
                  ChatMessage adaptedMessage = ChatMessage.builder().populate(msg).build();
                  List<ChatMessageStatus> adaptedStatuses = adaptStatuses(msg.getConversationId(), msg.getMessageId(), msg.getStatusUpdate());
                  for (ChatMessageStatus s : adaptedStatuses) {
                      adaptedMessage.addStatusUpdate(s);
                  }
                  chatMessages.add(adaptedMessage);
              }
          }
  
          return chatMessages;
      }
docs: Translates received messages through message query to chat SDK model.
  
  @param messagesReceived Foundation message objects.
  @return Chat SDK message objects.