@Override
  public void onCondition(@NotNull UnsatisfiedConditionProblem problem,
                          @NotNull DfaValue value,
                          @NotNull ThreeState failed,
                          @NotNull DfaMemoryState state) {
    if (problem instanceof MutabilityProblem mutabilityProblem && failed == ThreeState.YES) {
      reportMutabilityViolation(mutabilityProblem.isReceiver(), mutabilityProblem.getAnchor());
    }
    else if (problem instanceof NegativeArraySizeProblem arraySizeProblem) {
      myNegativeArraySizes.merge(arraySizeProblem.getAnchor(), failed, ThreeState::merge);
    }
    else if (problem instanceof ArrayIndexProblem indexProblem) {
      myOutOfBoundsArrayAccesses.merge(indexProblem.getAnchor(), failed, ThreeState::merge);
    }
    else if (problem instanceof ClassCastProblem castProblem) {
      myClassCastProblems.computeIfAbsent(castProblem.getAnchor(), e -> new StateInfo())
        .update(state, ThreeState.fromBoolean(failed != ThreeState.YES));
    }
    else if (problem instanceof ArrayStoreProblem storeProblem && failed == ThreeState.YES) {
      myArrayStoreProblems.put(storeProblem.getAnchor(), Pair.create(storeProblem.getFromType(), storeProblem.getToType()));
    }
    else if (problem instanceof ContractFailureProblem contractFailure) {
      Boolean isFailing = myFailingCalls.get(problem);
      if (isFailing != null || !hasTrivialFailContract(contractFailure.getAnchor())) {
        myFailingCalls.put(contractFailure, failed == ThreeState.YES && !Boolean.FALSE.equals(isFailing));
      }
    }
    else if (problem instanceof NullabilityProblemKind.NullabilityProblem<?> nullabilityProblem) {
      DfaNullability nullability = DfaNullability.fromDfType(state.getDfType(value));
      boolean notNullable = nullability != DfaNullability.NULL && nullability != DfaNullability.NULLABLE;
      boolean unknown = myStrictMode && nullability == DfaNullability.UNKNOWN;
      ThreeState ok = notNullable ? unknown ? ThreeState.UNSURE : ThreeState.YES : ThreeState.NO;
      StateInfo info = myStateInfos.computeIfAbsent(nullabilityProblem, k -> new StateInfo());
      info.update(state, ok);
    }
    else if (problem instanceof ConsumedStreamProblem consumedStreamProblem) {
      myStreamConsumed.computeIfAbsent(consumedStreamProblem.getAnchor(), e -> new StateInfo())
        .update(state, ThreeState.fromBoolean(failed != ThreeState.YES));
    }
  }
@Override
  public void onCondition(@NotNull UnsatisfiedConditionProblem problem,
                          @NotNull DfaValue value,
                          @NotNull ThreeState failed,
                          @NotNull DfaMemoryState state)