public Tree<T> filter(Filter<Tree<T>> filter) {
		if(filter.accept(this)){
			// 本节点满足，则包括所有子节点都保留
			return this;
		}

		final List<Tree<T>> children = getChildren();
		if (CollUtil.isNotEmpty(children)) {
			// 递归过滤子节点
			final List<Tree<T>> filteredChildren = new ArrayList<>(children.size());
			Tree<T> filteredChild;
			for (Tree<T> child : children) {
				filteredChild = child.filter(filter);
				if (null != filteredChild) {
					filteredChildren.add(filteredChild);
				}
			}
			if(CollUtil.isNotEmpty(filteredChildren)){
				// 子节点有符合过滤条件的节点，则本节点保留
				return this.setChildren(filteredChildren);
			} else {
				this.setChildren(null);
			}
		}

		// 子节点都不符合过滤条件，检查本节点
		return null;
	}
@Test
	public void filterTest() {
		// 经过过滤，丢掉"用户添加"节点
		final Tree<String> tree = TreeUtil.buildSingle(nodeList, "0");
		tree.filter((t) -> {
			final CharSequence name = t.getName();
			return null != name && name.toString().contains("店铺");
		});

		List<String> ids = new ArrayList<>();
		tree.walk((tr) -> ids.add(tr.getId()));
		assertEquals(4, ids.size());
	}