private void affectSealedClass(DifferentiateContext context, JvmNodeReferenceID sealedClassId, String affectReason, Utils utils, boolean affectSubclassUsages) {
    // for sealed classes all direct subclasses must be affected too
    Set<NodeSource> sourcesToAffect = collect(flat(map(KJvmUtils.withAllSubclassesIfSealed(utils, sealedClassId), utils::getNodeSources)), new HashSet<>());
    if (find(sourcesToAffect, src -> !context.isCompiled(src)) != null) {
      // only affect if at least one file in the set is not yet compiled in this session
      affectSources(context, sourcesToAffect, affectReason, true);
    }

    if (affectSubclassUsages) { // to track uses in 'when' expressions
      for (ReferenceID id : utils.directSubclasses(sealedClassId)) {
        String nodeName = utils.getNodeName(id);
        if (nodeName != null) {
          context.affectUsage(new ClassUsage(nodeName));
        }
      }
    }
  }
private void affectSealedClass(DifferentiateContext context, JvmNodeReferenceID sealedClassId, String affectReason, Utils utils, boolean affectSubclassUsages)