@Override
    public void selectWorker(long workerId) throws NonRecoverableException {
        if (getWorkerById(workerId) == null) {
            reportWorkerNotFoundException(workerId);
        }
        selectWorkerUnchecked(workerId);
    }
@Test
    public void testSelectWorker() throws UserException {
        HostBlacklist blockList = SimpleScheduler.getHostBlacklist();
        SystemInfoService sysInfo = GlobalStateMgr.getCurrentState().getNodeMgr().getClusterInfo();

        List<Long> availList = prepareNodeAliveAndBlock(sysInfo, blockList);
        WorkerProvider provider = newWorkerProvider();

        // intend to iterate the id out of the actual range.
        for (long id = -1; id < id2AllNodes.size() + 5; id++) {
            if (availList.contains(id)) {
                provider.selectWorker(id);
                testUsingWorkerHelper(provider, id);
            } else {
                long finalId = id;
                Assert.assertThrows(NonRecoverableException.class, () -> provider.selectWorker(finalId));
            }
        }
    }