@Nullable
  static TaskProvider<Task> getBootWarTaskProvider(Project project) {
    if (project.getPlugins().hasPlugin("org.springframework.boot")) {
      try {
        return project.getTasks().named("bootWar");
      } catch (UnknownTaskException ignored) { // fall through
      }
    }
    return null;
  }
@Test
  public void testGetBootWarTask_bootWarProject() {
    Project project = ProjectBuilder.builder().build();
    project.getPlugins().apply(WarPlugin.class);
    project.getPlugins().apply(SpringBootPlugin.class);

    TaskProvider<Task> bootWarTask = TaskCommon.getBootWarTaskProvider(project);
    assertThat(bootWarTask).isNotNull();
    assertThat(bootWarTask.get()).isInstanceOf(BootWar.class);
  }