void () { String output = """ 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<Long, String> processOwners = Map.of( 19608L, "user1", 12300L, "user2", 26284L, "user1" ); List<ProcessInfo> infos = ProcessListUtil.parseWinProcessListHelperOutput(output, processOwners, null); assertNull(ContainerUtil.find(infos, it -> it.isOwnedByCurrentUser() != ThreeState.UNSURE)); infos = ProcessListUtil.parseWinProcessListHelperOutput(output, processOwners, "user1"); assertEquals(ThreeState.YES, ContainerUtil.find(infos, it -> it.getPid() == 19608).isOwnedByCurrentUser()); assertEquals(ThreeState.YES, ContainerUtil.find(infos, it -> it.getPid() == 26284).isOwnedByCurrentUser()); assertEquals(ThreeState.NO, ContainerUtil.find(infos, it -> it.getPid() == 12300).isOwnedByCurrentUser()); assertEquals(ThreeState.NO, ContainerUtil.find(infos, it -> it.getPid() == 25064).isOwnedByCurrentUser()); }