### Question:
TaskCommon { @Nullable static TaskProvider<Task> getWarTaskProvider(Project project) { if (project.getPlugins().hasPlugin(WarPlugin.class)) { return project.getTasks().named(WarPlugin.WAR_TASK_NAME); } return null; } private  TaskCommon();  static final String VERSION_URL; }### Answer:
@Test public void testGetWarTask_normalJavaProject() { Project project = ProjectBuilder.builder().build(); project.getPlugins().apply(JavaPlugin.class); TaskProvider<Task> warProviderTask = TaskCommon.getWarTaskProvider(project); Assert.assertNull(warProviderTask); }
@Test public void testGetWarTask_normalWarProject() { Project project = ProjectBuilder.builder().build(); project.getPlugins().apply(WarPlugin.class); TaskProvider<Task> warTask = TaskCommon.getWarTaskProvider(project); Assert.assertNotNull(warTask); Assert.assertNotNull(warTask instanceof War); }