private static boolean isUsefulInstanceof(@NotNull DfaValue @NotNull [] args,
                                            @NotNull DfaValue value,
                                            @NotNull DfaMemoryState state) {
    if (args.length != 2) return true;
    DfType type = state.getDfType(value);
    if (type.equals(DfTypes.BOOLEAN)) {
      if (args[0] instanceof DfaTypeValue && args[1] instanceof DfaTypeValue && !DfaTypeValue.isUnknown(args[0])) {
        TypeConstraint left = TypeConstraint.fromDfType(args[0].getDfType());
        TypeConstraint right = TypeConstraint.fromDfType(args[1].getDfType());
        return !right.isSuperConstraintOf(left);
      }
      return true;
    }
    return type.equals(DfTypes.FALSE) && DfaNullability.fromDfType(state.getDfType(args[0])) != DfaNullability.NULL;
  }
private static boolean isUsefulInstanceof(@NotNull DfaValue @NotNull [] args,
                                            @NotNull DfaValue value,
                                            @NotNull DfaMemoryState state)