private Map listsToStrings()

in src/main/java/com/epam/digital/data/platform/kafkaapi/core/commandhandler/util/EntityConverter.java [114:128]


  private Map<String, Object> listsToStrings(Map<String, Object> entityMap) {
    return entityMap.entrySet().stream()
        .filter(entry -> entry.getValue() instanceof List)
        .map(entry -> {
          var list = (List<?>) entry.getValue();
          if(!list.isEmpty() && list.get(0) instanceof LinkedHashMap) {
            var listOfStrings = ((List<LinkedHashMap>)entry.getValue()).stream()
                .map(this::toCompatibleStringWithInnerMap)
                .collect(Collectors.toList());
            entry.setValue(listOfStrings);
          }
          return Map.entry(entry.getKey(), toCompatibleString((Collection<?>) entry.getValue()));
        })
        .collect(Collectors.toMap(Entry::getKey, Entry::getValue));
  }