private boolean determineGroupAndParentsVisibility(final ItemGroup<Object, Object> itemGroup, final Map<Object, Boolean> determinedGroups) {
        if (itemGroup == null || itemGroup.getGroup() == null || itemGroup.getParent() == null) {
            return true;
        }
        if (determinedGroups.containsKey(itemGroup.getGroup())) {
            return Boolean.TRUE.equals(determinedGroups.get(itemGroup.getGroup()));
        }
        final boolean isParentExpanded = isGroupExpanded(itemGroup.getParent().getGroup());
        final boolean isParentVisible = determineGroupAndParentsVisibility(itemGroup.getParent(), determinedGroups);
        final boolean isVisible = isParentVisible && isParentExpanded;
        determinedGroups.put(itemGroup.getGroup(), isVisible);
        return isVisible;
    }
This view displays and maintains a list of simple view items, mainly for (single or multiple)
item selection lists. It provides special support for grouping, filtering and "select all" for such
lists.
main/src/main/java/cgeo/geocaching/ui/SimpleItemListView.java