code: private static JsonArray toJsonArray(Collection<String> values) {
          JsonArray array = new JsonArray();
          for (String value : values) {
              array.add(value);
          }
          return array;
  
      }
docs: Helper function to create JsonArray from collection.
  
  @param values collection of values to convert to JsonArray
  @return JsonArray with collection values