code: public static boolean hasChildWithThisName( AbstractApplication application, Instance parentInstance, String nameToSearch ) {
  
  		boolean hasAlreadyAChildWithThisName = false;
  		Collection<Instance> list = parentInstance == null ? application.getRootInstances() : parentInstance.getChildren();
  		for( Iterator<Instance> it = list.iterator(); it.hasNext() && ! hasAlreadyAChildWithThisName; ) {
  			hasAlreadyAChildWithThisName = Objects.equals( nameToSearch, it.next().getName());
  		}
  
  		return hasAlreadyAChildWithThisName;
  	}
docs: Determines whether an instance name is not already used by a sibling instance.
  @param application the application (not null)
  @param parentInstance the parent instance (can be null to indicate a root instance)
  @param nameToSearch the name to search
  @return true if a child instance of <code>parentInstance</code> has the same name, false otherwise