@Override
    String generate(ChainVariable inVar, StreamToLoopReplacementContext context) {
      PsiType resultType = context.createType(myResultType);
      resultType = correctTypeParameters(resultType, CommonClassNames.JAVA_UTIL_MAP,
                                         Collections.singletonMap("V", myCollector::correctReturnType));
      String map = context.declareResult("map", resultType, CommonClassNames.JAVA_UTIL_MAP, "new java.util.HashMap<>()", ResultKind.FINAL);
      myPredicate.transform(context, inVar.getName());
      myCollector.transform(context, inVar.getName());
      context.addBeforeStep(map + ".put(false, " + myCollector.getSupplier() + ");");
      context.addBeforeStep(map + ".put(true, " + myCollector.getSupplier() + ");");
      String key = myPredicate.getText();
      String merger = myCollector.getMerger(inVar, map, key);
      if (merger != null) return merger;
      return myCollector.getAccumulatorUpdater(inVar, map + ".get(" + key + ")");
    }
@Override
    String generate(ChainVariable inVar, StreamToLoopReplacementContext context)