code: static Collection<String> toCollection(String list) {
          Collection<String> result = new ArrayList<>();
          if (list != null) {
              String[] values = list.split(",");
              for (String value : values) {
                  String trimmed = value.trim();
                  if (!trimmed.isEmpty()) {
                      result.add(trimmed);
                  }
              }
          }
          return result;
      }
docs: Return the provided comma-separated String as a collection. Order is maintained.
  
  @param list
  @return Ordered collection