private static boolean isIdentical(TreeNode n1, TreeNode n2) {
        if (n1 == null && n2 == null) return true;
        if (n1 == null || n2 == null) return false;
        if (n1.value != n2.value) return false;
        return isIdentical(n1.left, n2.left) &&
               isIdentical(n1.right, n2.right);
    }