class Traverser extends AlgoTraverser {

        public Traverser(UserJob<Object> job, int workers) {
            super(job, ALGO_NAME, workers);
        }

        public Object kcore(String sourceLabel, String sourceCLabel,
                            Directions dir, String label, int k, double alpha,
                            long degree, boolean merged) {<FILL_FUNCTION_BODY>}

        private static void mergeKcores(Set<Set<Id>> kcores, Set<Id> kcore) {
            boolean merged = false;
            /*
             * Iterate to collect merging kcores firstly, because merging
             * kcores will be removed from all kcores.
             * Besides one new kcore may connect to multiple existing kcores.
             */
            Set<Set<Id>> mergingKcores = new HashSet<>();
            for (Set<Id> existedKcore : kcores) {
                if (CollectionUtil.hasIntersection(existedKcore, kcore)) {
                    mergingKcores.add(existedKcore);
                    merged = true;
                }
            }
            if (merged) {
                for (Set<Id> mergingKcore : mergingKcores) {
                    kcores.remove(mergingKcore);
                    kcore.addAll(mergingKcore);
                }
            }
            kcores.add(kcore);
        }
    }

            HugeGraph graph = this.graph();

            KcoreTraverser traverser = new KcoreTraverser(graph);
            JsonMap kcoresJson = new JsonMap();
            kcoresJson.startObject();
            kcoresJson.appendKey("kcores");
            kcoresJson.startList();

            Set<Set<Id>> kcores = new HashSet<>();

            this.traverse(sourceLabel, sourceCLabel, v -> {
                Set<Id> kcore = traverser.kcore(IteratorUtils.of(v),
                                                dir, label, k, alpha, degree);
                if (kcore.isEmpty()) {
                    return;
                }
                if (merged) {
                    synchronized (kcores) {
                        mergeKcores(kcores, kcore);
                    }
                } else {
                    String json = JsonUtil.toJson(kcore);
                    synchronized (kcoresJson) {
                        kcoresJson.appendRaw(json);
                    }
                }
            });

            if (merged) {
                for (Set<Id> kcore : kcores) {
                    kcoresJson.appendRaw(JsonUtil.toJson(kcore));
                }
            }

            kcoresJson.endList();
            kcoresJson.endObject();

            return kcoresJson.asJson();
        
<methods>public non-sealed void <init>() ,public java.lang.String category() <variables>private static final int MAX_TIMES