public static boolean hasCompilationErrors(@NotNull ProjectTaskManager.Result result) {
    return result.anyTaskMatches((task, state) -> task instanceof ModuleBuildTask &&
                                                  state.isFailed());
  }
public static boolean hasCompilationErrors(@NotNull ProjectTaskManager.Result result)