List<String> (String orderPart) { List<String> result = new ArrayList<>(); List<String> subParts = StringUtil.split(orderPart, " "); subParts.forEach(s -> { if (":".equals(s)) { result.add(s); } else { Collections.addAll(result, s.split(":")); } }); return result; }