### Question:
TreeTransformator extends AbstractTreeTransformingProcessor { public static IFilter compact(ITreeFilter filter) { return new Filter(FilterType.COMPACT,filter); } TreeTransformator(ISerializedObjectTreeProcessor destination, IFilter... filter); static IFilter strip(ITreeFilter filter); static IFilter compact(ITreeFilter filter);  }### Answer:
@Test public void compactWithNoChange() throws IOException { ISerializedObjectTree tree = Trees.fromResource(getClass(), "treeOf3"); ISerializedObjectTree filtered = TreeTransformations.compact(tree, new AcceptAll()); Trees.assertEqualsTree(tree, filtered); assertTrue(tree == filtered); }
@Test public void removeAllNodesDeeperThan2() throws IOException { ISerializedObjectTree tree = Trees.fromResource(getClass(), "treeOf3"); ISerializedObjectTree filtered = TreeTransformations.compact(tree, new MaxDepth(2)); ISerializedObjectTree expected = Trees.fromResource(getClass(), "treeOf3-maxDepth1"); Trees.assertEqualsTree(expected, filtered); }