### Question:
GradlePlugin implements Plugin<Project> { public void apply(Project project) { project.getExtensions().create("cayenne", GradleCayenneExtension.class, project); Map<String, Object> map = new HashMap<>(1); map.put("type", CgenTask.class); project.task(map, "cgen"); Map<String, Object> map1 = new HashMap<>(1); map1.put("type", DbImportTask.class); project.task(map1, "cdbimport"); Map<String, Object> map2 = new HashMap<>(1); map2.put("type", DbGenerateTask.class); project.task(map2, "cdbgen"); }  void apply(Project project);  }### Answer:
@Test public void apply() throws Exception { Project project = ProjectBuilder.builder().build(); project.getPluginManager().apply("org.apache.cayenne"); assertTrue(project.getTasks().getByName("cgen") instanceof CgenTask); assertTrue(project.getTasks().getByName("cdbimport") instanceof DbImportTask); assertTrue(project.getTasks().getByName("cdbgen") instanceof DbGenerateTask); assertTrue(project.getExtensions().getByName("cayenne") instanceof GradleCayenneExtension); }