public static TreeNode findFirstCommonAncestor(TreeNode root, TreeNode n1, TreeNode n2) {
        if (root == null) return null;
        if (root == n1 && contains(root, n2) ||
            root == n2 && contains(root, n1)) return root;
        boolean n1OnLeft = contains(root.left, n1);
        boolean n2OnLeft = contains(root.left, n2);
        if (n1OnLeft && n2OnLeft) {
            return findFirstCommonAncestor(root.left, n1, n2);
        } else if (!n1OnLeft && !n2OnLeft) {
            return findFirstCommonAncestor(root.right, n1, n2);
        } else {
            return root;
        }
    }