Bug 65240 Hierarchical layout: Problems with inclusion filters [package explorer]
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/packageview/PackageFragmentProvider.java
private IPackageFragment findChildrenToBeCompounded(IPackageFragment fragment) throws JavaModelException {
		Object[] children = getChildren(fragment);
		if ((children.length == 1) && (children[0] instanceof IPackageFragment)) {
			if (isEmpty((IPackageFragment) children[0]))
				return findChildrenToBeCompounded((IPackageFragment) children[0]);
			else return (IPackageFragment)children[0];
		}
		return fragment;
	}
	
	private boolean isEmpty(IPackageFragment fragment) throws JavaModelException {
		return (!fragment.containsJavaResources()) && (fragment.getNonJavaResources().length==0);
	}
	
	private Object[] findNextLevelChildrenByElementName(IPackageFragmentRoot parent, IPackageFragment fragment) {
		List list= new ArrayList();
		try {
			IJavaElement[] children= parent.getChildren();
			String fragmentname= fragment.getElementName();
			for (int i= 0; i < children.length; i++) {
				IJavaElement element= children[i];
				if (element instanceof IPackageFragment) {
					IPackageFragment frag= (IPackageFragment) element;
					String name= element.getElementName();
					if (!"".equals(fragmentname) && name.startsWith(fragmentname) && !name.equals(fragmentname)) { 
						String tail= name.substring(fragmentname.length() + 1);
						if (!"".equals(tail) && (tail.indexOf(".") == -1)) {
							list.add(frag);
						}