public List<Long> getWorkersByWorkerGroup(long workerGroupId) throws UserException {
        List<Long> nodeIds = new ArrayList<>();
        prepare();
        try {
            List<WorkerGroupDetailInfo> workerGroupDetailInfos = client.
                    listWorkerGroup(serviceId, Collections.singletonList(workerGroupId), true);
            for (WorkerGroupDetailInfo detailInfo : workerGroupDetailInfos) {
                detailInfo.getWorkersInfoList()
                        .forEach(x -> getOrUpdateNodeIdByWorkerInfo(x).ifPresent(nodeIds::add));
            }
            return nodeIds;
        } catch (StarClientException e) {
            throw new UserException("Failed to get workers by group id. error: " + e.getMessage());
        }
    }
@Test
    public void testGetWorkers() throws StarClientException, UserException {
        String serviceId = "1";
        Deencapsulation.setField(starosAgent, "serviceId", serviceId);

        long workerId0 = 10000L;
        WorkerInfo worker0 = newWorkerInfo(workerId0, "127.0.0.1:8090", 9050, 9060, 8040, 8060, 10);
        long workerId1 = 10001L;
        WorkerInfo worker1 = newWorkerInfo(workerId1, "127.0.0.2:8091", 9051, 9061, 8041, 8061, 10);
        long groupId0 = 10L;
        WorkerGroupDetailInfo group0 = WorkerGroupDetailInfo.newBuilder().setGroupId(groupId0).addWorkersInfo(worker0)
                .addWorkersInfo(worker1).build();

        long workerId2 = 10002L;
        WorkerInfo worker2 = newWorkerInfo(workerId2, "127.0.0.3:8092", 9052, 9062, 8042, 8062, 10);
        long groupId1 = 11L;
        WorkerGroupDetailInfo group1 = WorkerGroupDetailInfo.newBuilder().setGroupId(groupId1).addWorkersInfo(worker2)
                .build();

        new Expectations() {
            {
                client.getWorkerInfo(serviceId, workerId0);
                minTimes = 0;
                result = worker0;

                client.listWorkerGroup(serviceId, Lists.newArrayList(groupId0), true);
                minTimes = 0;
                result = Lists.newArrayList(group0);

                client.listWorkerGroup(serviceId, Lists.newArrayList(), true);
                minTimes = 0;
                result = Lists.newArrayList(group0, group1);
            }
        };

        List<Long> nodes = starosAgent.getWorkersByWorkerGroup(groupId0);
        Assert.assertEquals(2, nodes.size());
    }