private static ConnectedComponent findComponent(Long2ShortHashMapInterface hm, long startKmer,
                                             LongArrayFIFOQueue queue,
                                                   int k, int b2, int newFreqThreshold) {

        ConnectedComponent comp = new ConnectedComponent();

        queue.clear();
        boolean bigComp = false;

        queue.enqueue(startKmer);
        short value = hm.get(startKmer);
        assert value > 0;
        hm.put(startKmer, (short) -value);  // removing
        comp.add(startKmer, value);

        while (queue.size() > 0) {
            long kmer = queue.dequeue();

            for (long neighbour : KmerOperations.possibleNeighbours(kmer, k)) {
                value = hm.get(neighbour);
                if (value > 0) {    // i.e. if not precessed
                    queue.enqueue(neighbour);
                    hm.put(neighbour, (short) -value);
                    if (bigComp) {
                        if (value >= newFreqThreshold) {
                            comp.hm.put(neighbour, value);
                        }
                        comp.size++;
                    } else {
                        comp.add(neighbour, value);
                        if (comp.size == b2) {
                            // component is big one
                            bigComp = true;
                            comp.hm = new BigLong2ShortHashMap(4, 13);
                            for (long kk : comp.kmers) {
                                value = (short) -hm.get(kk);
                                assert value > 0;
                                if (value >= newFreqThreshold) {
                                    comp.hm.put(kk, value);
                                }
                            }
                            comp.kmers = null;
                        }
                    }
                }
            }
        }

        return comp;
    }