@Nullable
  static TaskProvider<Task> getWarTaskProvider(Project project) {
    if (project.getPlugins().hasPlugin(WarPlugin.class)) {
      return project.getTasks().named(WarPlugin.WAR_TASK_NAME);
    }
    return null;
  }
@Test
  public void testGetWarTask_normalJavaProject() {
    Project project = ProjectBuilder.builder().build();
    project.getPlugins().apply(JavaPlugin.class);

    TaskProvider<Task> warProviderTask = TaskCommon.getWarTaskProvider(project);
    assertThat(warProviderTask).isNull();
  }