public static boolean isAnyPosixProcessPidDirAlive(Collection<Long> pids, String user) throws IOException {
        return isAnyPosixProcessPidDirAlive(pids, user, false);
    }
@Test
    public void testIsAnyPosixProcessPidDirAliveMockingFileOwnerUid() throws Exception {
        File procDir = new File("/proc");
        if (!procDir.exists()) {
            LOG.info("Test testIsAnyPosixProcessPidDirAlive is designed to run on systems with /proc directory only, marking as success");
            return;
        }
        Collection<Long> allPids = getRunningProcessIds(null);
        Collection<Long> rootPids = getRunningProcessIds("root");
        assertFalse(allPids.isEmpty());
        assertFalse(rootPids.isEmpty());

        String currentUser = System.getProperty("user.name");

        for (boolean mockFileOwnerToUid: Arrays.asList(true, false)) {
            // at least one pid will be owned by the current user (doing the testing)
            boolean status = ServerUtils.isAnyPosixProcessPidDirAlive(allPids, currentUser, mockFileOwnerToUid);
            String err = String.format("(mockFileOwnerToUid=%s) Expecting user %s to own at least one process",
                    mockFileOwnerToUid, currentUser);
            assertTrue(status, err);
        }

        // simulate reassignment of all process id to a different user (root)
        for (boolean mockFileOwnerToUid: Arrays.asList(true, false)) {
            boolean status = ServerUtils.isAnyPosixProcessPidDirAlive(rootPids, currentUser, mockFileOwnerToUid);
            String err = String.format("(mockFileOwnerToUid=%s) Expecting user %s to own no process",
                    mockFileOwnerToUid, currentUser);
            assertFalse(status, err);
        }
    }