boolean (@NotNull ExternalSystemTask task) { if (task instanceof ExternalSystemExecuteTaskTask taskTask) { if (StringUtil.equals(taskTask.getExternalSystemId().getId(), GradleConstants.SYSTEM_ID.getId())) { var isRunAsTest = taskTask.getUserData(GradleRunConfiguration.RUN_AS_TEST_KEY); if (ObjectUtils.chooseNotNull(isRunAsTest, false)) { return true; } if (hasTestTasks(taskTask)) { taskTask.putUserData(GradleRunConfiguration.RUN_AS_TEST_KEY, true); return true; } } } return false; }