if(object instanceof LogicalPackage){ LogicalPackage element= (LogicalPackage) object; element.remove(frag); if(element.getFragments().length == 1){ IPackageFragment fragment= element.getFragments()[0]; fMapToCompoundElement.put(key, fragment);  postRemove(element);
if(lp != null){ lp.remove(frag);  if(lp.getFragments().length == 1){ IPackageFragment fragment= lp.getFragments()[0]; fMapToLogicalPackage.remove(key); fMapToPackageFragments.put(key,fragment);   postRemove(lp);
	private void removeElement(IPackageFragment frag) {		String key= getKey(frag);		Object object= fMapToCompoundElement.get(key);			if(object instanceof LogicalPackage){			LogicalPackage element= (LogicalPackage) object;			element.remove(frag);			if(element.getFragments().length == 1){				IPackageFragment fragment= element.getFragments()[0];				fMapToCompoundElement.put(key, fragment);						//@Improve: is this correct?				postRemove(element);				postAdd(fragment);				//postRefresh(fragment.getJavaProject());			} return;		} else {			fMapToCompoundElement.remove(key);				postRemove(frag);			}	}