String defUnitModuleQualifiedName = StringUtil.substringAfterMatch(expectedTarget, "/");
boolean removed = false;
if(moduleName == null ) {
for (Iterator<INamedElement> iterator = resultDefUnits.iterator(); iterator.hasNext(); ) {
INamedElement element = iterator.next();
if(element.getName().equals(expectedTarget)) {
iterator.remove();
removed = true;
}
}
} else {
String expectedFullyTypedQualification = moduleName +
(defUnitModuleQualifiedName != null ? "/" + defUnitModuleQualifiedName : "");
for (Iterator<INamedElement> iterator = resultDefUnits.iterator(); iterator.hasNext(); ) {
INamedElement element = iterator.next();
String defUnitTypedQualification = NamedElementUtil.getElementTypedQualification(element);
if(defUnitTypedQualification.equals(expectedFullyTypedQualification)) {
iterator.remove();
removed = true;