@@ -0,0 +1,1249 @@
+package com.ttaylorr.ctci.answers.trees;%0A%0Aimport com.ttaylorr.ctci.answers.trees.util.TreeNode;%0Aimport com.ttaylorr.ctci.meta.Solution;%0A%0A@Solution(chapter = 4, problem = 7)%0Apublic class SubtreeTest %7B%0A    public static SubtreeTest of(TreeNode largeBase) %7B%0A        return new SubtreeTest(largeBase);%0A    %7D%0A%0A    protected final TreeNode largeBase;%0A    public SubtreeTest(TreeNode largeBase) %7B%0A        this.largeBase = largeBase;%0A    %7D%0A%0A    public boolean containsTree(TreeNode other) %7B%0A        if (other == null) return true;%0A        else return this.subTree(this.largeBase, other);%0A    %7D%0A%0A    private boolean subTree(TreeNode a, TreeNode b) %7B%0A        if (a == null) %7B%0A            return false;%0A        %7D else if (a.value == b.value) %7B%0A            return this.matchTree(a, b);%0A        %7D else %7B%0A            return subTree(a.left, b) %7C%7C subTree(a.right, b);%0A        %7D%0A    %7D%0A%0A    private boolean matchTree(TreeNode a, TreeNode b) %7B%0A        if (b == null && a == null) %7B%0A            return true;%0A        %7D else if (a == null %7C%7C b == null) %7B%0A            return false;%0A        %7D else if (a.value != b.value) %7B%0A            return false;%0A        %7D else %7B%0A            return this.matchTree(a.left, b.left) && this.matchTree(a.right, b.right);%0A        %7D%0A    %7D%0A%7D%0A

Add subtree test problem