def METHOD_NAME(self):
    class CustomTree(Tree):
        pass
    class TreeChecker(Visitor):
        def __default__(self, tree):
            assert isinstance(tree, CustomTree)
    tree = TreeForestTransformer(resolve_ambiguity=False, tree_class=CustomTree).transform(self.forest)
    TreeChecker().visit(tree)