void () { List<ProcessInfo> infos = ProcessListUtil.parseWinProcessListHelperOutput( """ pid:19608 parentPid:0 name:SourceTree.exe cmd:"C:\\\\Users\\\\grahams\\\\AppData\\\\Local\\\\SourceTree\\\\app-3.1.3\\\\SourceTree.exe" pid:12300 parentPid:0 name:conhost.exe cmd:\\\\??\\\\C:\\\\Windows\\\\system32\\\\conhost.exe 0x4 pid:26284 parentPid:0 name:Unity Hub.exe cmd:"C:\\\\Program Files\\\\Unity Hub\\\\Unity Hub.exe" --no-sandbox --lang=en-US --node-integration=true /prefetch:1 pid:25064 parentPid:12300 name:cmd.exe cmd:"C:\\\\WINDOWS\\\\system32\\\\cmd.exe" /c "pause\\necho 123" """, Map.of( 19608L, "user1", 12300L, "user2", 26284L, "user1" ), null); assertOrderedEquals( infos, new ProcessInfo(19608, "\"C:\\Users\\grahams\\AppData\\Local\\SourceTree\\app-3.1.3\\SourceTree.exe\"", "SourceTree.exe", "", null, 0, "user1", ThreeState.UNSURE), new ProcessInfo(12300, "\\??\\C:\\Windows\\system32\\conhost.exe 0x4", "conhost.exe", "0x4", null, 0, "user2", ThreeState.UNSURE), new ProcessInfo(26284, "\"C:\\Program Files\\Unity Hub\\Unity Hub.exe\" --no-sandbox --lang=en-US --node-integration=true /prefetch:1", "Unity Hub.exe", "--no-sandbox --lang=en-US --node-integration=true /prefetch:1", null, 0, "user1", ThreeState.UNSURE), new ProcessInfo(25064, "\"C:\\WINDOWS\\system32\\cmd.exe\" /c \"pause\necho 123\"", "cmd.exe", "/c \"pause\necho 123\"", null, 12300, null, ThreeState.UNSURE) ); assertNull(ProcessListUtil.parseWinProcessListHelperOutput("", Collections.emptyMap(), null)); assertNull(ProcessListUtil.parseWinProcessListHelperOutput("Hello", Collections.emptyMap(), null)); assertNull(ProcessListUtil.parseWinProcessListHelperOutput(""" pid:12345 name:git.exe cmd:git.exe fetch pid:1x name:node.exe cmd:node.exe qq """, Collections.emptyMap(), null)); }