code: private void deleteClass(Outline outline, JDefinedClass clazz) {
  		if (clazz.parentContainer().isClass()) {
  			// The candidate class is an inner class. Remove the class from its parent class.
  			JDefinedClass parentClass = (JDefinedClass) clazz.parentContainer();
  
  			writeSummary("\tRemoving class " + clazz.fullName() + " from class " + parentClass.fullName());
  
  			for (Iterator<JDefinedClass> iter = parentClass.classes(); iter.hasNext();) {
  				if (iter.next().equals(clazz)) {
  					iter.remove();
  					break;
  				}
  			}
  		}
  		else {
  			// The candidate class is in a package. Remove the class from the package.
  			JPackage parentPackage = (JPackage) clazz.parentContainer();
  
  			writeSummary("\tRemoving class " + clazz.fullName() + " from package " + parentPackage.name());
  
  			parentPackage.remove(clazz);
  
  			// And also remove the class from model.
  			for (Iterator<? extends ClassOutline> iter = outline.getClasses().iterator(); iter.hasNext();) {
  				ClassOutline classOutline = iter.next();
  				if (classOutline.implClass == clazz) {
  					outline.getModel().beans().remove(classOutline.target);
  					Set<Object> packageClasses = getPrivateField(classOutline._package(), "classes");
  					packageClasses.remove(classOutline);
  					iter.remove();
  					break;
  				}
  			}
  		}
  	}
docs: Remove the given class from it's parent class or package it is defined in.