public static List<String> splitPath(String path) {
        List<String> results = new ArrayList<>();
        String[] components = path.split("/");
        for (String component : components) {
            if (!component.isEmpty()) {
                results.add(component);
            }
        }
        return results;
    }
Convert a path to a list of path components.
Multiple slashes in a row are treated the same as a single slash.
Trailing slashes are ignored.
shell/src/main/java/org/apache/kafka/shell/command/CommandUtils.java