MyNode (final TreeNode root, final Condition<? super NamedConfigurable> condition) { return TreeUtil.treeNodeTraverser(root) .filter(MyNode.class) .filter(node -> condition.value(node.getConfigurable())) .first(); }