public BoundTree apply(ReparentedTree reparentedTree) {
Set<Callable> requirements = Sets.newHashSet();
AlertSetBuilder alertSetBuilder = new AlertSetBuilder(reparentedTree.getAlerts());
Root oldRoot = reparentedTree.getRoot();
ServiceDirectory serviceDirectory =
new ScopedServiceDirectory(alertSetBuilder,
baseServiceDirectory,
oldRoot.getName().getPackageName(),
oldRoot.getImports());
Root newRoot = oldRoot.acceptVisitor(
new Visitor(alertSetBuilder, schemaFactory, serviceDirectory, requirements));
return new BoundTree(reparentedTree.getSourcePosition(), alertSetBuilder.buildAndClear(),
newRoot, requirements);
}