void () { String output = """ Caption CommandLine ExecutablePath ParentProcessId ProcessId \s smss.exe 0 304 \s sihost.exe sihost.exe 304 3052 \s taskhostw.exe taskhostw.exe {222A245B-E637-4AE9-A93F-A59CA119A75E} 0 3068 \s explorer.exe C:\\WINDOWS\\Explorer.EXE C:\\WINDOWS\\Explorer.EXE 3068 3164 \s TPAutoConnect.exe TPAutoConnect.exe -q -i vmware -a COM1 -F 30 3164 3336 \s conhost.exe \\??\\C:\\WINDOWS\\system32\\conhost.exe 0x4 \\??\\C:\\WINDOWS\\system32\\conhost.exe 0 3348 \s """; Map<Long, String> processOwners = Map.of( 304L, "user1", 3052L, "user2", 3068L, "user1" ); List<ProcessInfo> infos = ProcessListUtil.parseWMICOutput(output, processOwners, null); assertNull(ContainerUtil.find(infos, it -> it.isOwnedByCurrentUser() != ThreeState.UNSURE)); infos = ProcessListUtil.parseWMICOutput(output, processOwners, "user1"); assertEquals(ThreeState.YES, ContainerUtil.find(infos, it -> it.getPid() == 304).isOwnedByCurrentUser()); assertEquals(ThreeState.YES, ContainerUtil.find(infos, it -> it.getPid() == 3068).isOwnedByCurrentUser()); assertEquals(ThreeState.NO, ContainerUtil.find(infos, it -> it.getPid() == 3052).isOwnedByCurrentUser()); assertEquals(ThreeState.NO, ContainerUtil.find(infos, it -> it.getPid() == 3348).isOwnedByCurrentUser()); }