private void recCountExpected(BaseBlock b, List<BaseBlock> next) {
        List<Statement> inBB = b.getStatements();
        numOfSt += inBB.size();
        Statement curS = inBB.get(inBB.size()-1);

        List<Statement> before = new LinkedList<Statement>();
        if(expectedOut.get(curS) != null) {
            before.addAll(expectedOut.get(curS));
            expectedOut.get(curS).clear();
        }

        if(next != null) {
            List<Statement> nextSts = new LinkedList<Statement>();//statements, which follow the last statement of b
            for (BaseBlock bb : next)
                nextSts.add(bb.getStatements().get(0));
            funcExpectedOut(curS, nextSts);//count OUT[B] = ^(s from succ(b)) IN[s]  ~ out[last st of b]
        } else funcExpectedOut(curS, null);

        if(ifIsChanged(before, expectedOut.get(curS)))
            isChanged = true;
        before.clear();
        if(expectedIn.get(curS) != null)
            before.addAll(expectedIn.get(curS));

        funcExpectedIn(curS);//IN[B] -fills expectedIn for curS

        if(ifIsChanged(before, expectedIn.get(curS)))
            isChanged = true;

        int i = 0;
        for (i = inBB.size()-2; i >= 0; i--) {
            Statement nextS = inBB.get(i);
            before.clear();
            if(expectedOut.get(nextS) != null)
                before.addAll(expectedOut.get(nextS));

            expectedOut.put(nextS, new LinkedList<Statement>());
            //--count-expOut-for-cur------


            if(expectedIn.get(curS) != null) {
                expectedOut.get(nextS).clear();
                expectedOut.get(nextS).addAll(expectedIn.get(curS));
            }

            if(ifIsChanged(before, expectedOut.get(nextS))) {
                //System.out.println("!!CHANGED");
                isChanged = true;
            }


            curS = nextS;
            //--count-expIn-for-cur-------
            before.clear();
            if(expectedIn.get(curS) != null)
                before.addAll(expectedIn.get(curS));

            funcExpectedIn(curS);//IN[B] -fills expectedIn for curS

            if(ifIsChanged(before, expectedIn.get(curS)))
                isChanged = true;
        }

        markBB.remove(b); markBB.put(b, true);
        for(BaseBlock c: cfg.prevBB(b)) {
            boolean count = true;

            List<BaseBlock> n = cfg.nextBB(c);
            for(BaseBlock nn: n)
               if(!markBB.get(nn))
                 count = false;

            //if(count) {//&& !markBB.get(b)
            //System.out.println("count="  + count +markBB.get(c) + " " + c.getStatements());
            if(!markBB.get(c)) {
                markBB.put(c, true);
                recCountExpected(c, n);         //!!!если в nextBB есть с непосчитанными Statements, то не выполняем
            }
        }
    }