### Question:
CascadingUtil { public static void renameCascadingChildLinks(ICascadingJob cascadingProject, String oldName, String newName) throws IOException { if (cascadingProject != null) { cascadingProject.renameCascadingChildName(oldName, newName); if (cascadingProject.hasCascadingProject()) { renameCascadingChildLinks(cascadingProject.getCascadingProject(), oldName, newName); } } }  static IProjectProperty getProjectProperty(Job currentJob, String key); static StringProjectProperty getStringProjectProperty(Job currentJob, String key); static BaseProjectProperty getBaseProjectProperty(Job currentJob, String key); static ExternalProjectProperty getExternalProjectProperty(Job currentJob, String key); static CopyOnWriteListProjectProperty getCopyOnWriteListProjectProperty(Job currentJob, String key); static ResultProjectProperty getResultProjectProperty(Job currentJob, String key); static BooleanProjectProperty getBooleanProjectProperty(Job currentJob, String key); static IntegerProjectProperty getIntegerProjectProperty(Job currentJob, String key); static LogRotatorProjectProperty getLogRotatorProjectProperty(Job currentJob, String key); static DescribableListProjectProperty getDescribableListProjectProperty(Job currentJob, String key); static AxisListProjectProperty getAxesListProjectProperty(Job currentJob, String key); static SCMProjectProperty getScmProjectProperty(Job currentJob, String key); static TriggerProjectProperty getTriggerProjectProperty(Job currentJob, String key); @SuppressWarnings("unchecked") static T getProjectProperty(ICascadingJob currentJob, String key, Class<T> clazz); @SuppressWarnings("unchecked") static boolean hasCyclicCascadingLink(Job cascadingCandidate, Set<String> cascadingChildren); static boolean unlinkProjectFromCascadingParents(ICascadingJob cascadingProject, String projectToUnlink); static void linkCascadingProjectsToChild(ICascadingJob cascadingProject, String childProjectName); static void renameCascadingChildLinks(ICascadingJob cascadingProject, String oldName, String newName); static void renameCascadingParentLinks(final String oldName, final String newName); @SuppressWarnings("unchecked") static List<Job> getCascadingParents(Class<T> type, Job currentJob); @SuppressWarnings("unchecked") static void buildExternalProperties(StaplerRequest req, JSONObject json,
                                                                          List<Descriptor<T>> descriptors, Job owner); @SuppressWarnings("unchecked") static void setChildrenTrigger(Job job, TriggerDescriptor descriptor, String key, StaplerRequest req,
                                          JSONObject json); @SuppressWarnings("unchecked") static void setParameterDefinitionProperties(Job job,
                                                        String key,
                                                        CopyOnWriteList<ParametersDefinitionProperty> parameterDefinitionProperties); static boolean isCascadableJobProperty(JobPropertyDescriptor d);  }### Answer:
@Test public void testRenameCascadingChildLinks() throws Exception { String oldName = "oldCascadingProject"; String newName = "newCascadingProject"; FreeStyleProject project1 = new FreeStyleProjectMock("project1"); FreeStyleProjectMock project2 = new FreeStyleProjectMock("project2"); FreeStyleProjectMock project3 = new FreeStyleProjectMock(oldName); project2.setCascadingProject(project1); CascadingUtil.linkCascadingProjectsToChild(project1, "project2"); project3.setCascadingProject(project2); CascadingUtil.linkCascadingProjectsToChild(project2, oldName); assertTrue(project2.getCascadingChildrenNames().contains(oldName)); assertTrue(project1.getCascadingChildrenNames().contains(oldName)); CascadingUtil.renameCascadingChildLinks(project2, oldName, newName); assertTrue(project2.getCascadingChildrenNames().contains(newName)); assertFalse(project2.getCascadingChildrenNames().contains(oldName)); assertTrue(project1.getCascadingChildrenNames().contains(newName)); assertFalse(project1.getCascadingChildrenNames().contains(oldName)); }
@Test public void testRenameCascadingChildLinksNullProject() throws Exception { CascadingUtil.renameCascadingChildLinks(null, "name", "newName"); }