/** Creates a {@link SameType} for comparing two trees of the same type. */ public static <T> SameType<T> of(TreeDef<T> treeDef, T expected, T actual) { return of(treeDef, expected, treeDef, actual).mapToSame(Function.identity(), Function.identity()); }
/** Creates a {@link SameType} for comparing a {@link TreeNode} against a generic tree which been mapped. */ public static <T, U> SameType<T> of(TreeNode<T> expected, TreeDef<U> treeDef, U actual, Function<? super U, ? extends T> mapper) { return of(TreeNode.treeDef(), expected, treeDef, actual).mapToSame(TreeNode::getContent, mapper); }
/** Creates a {@link SameType} from the given two {@link TreeNode}s of the same type. */ public static <T> SameType<T> of(TreeNode<T> expected, TreeNode<T> actual) { return of(TreeNode.treeDef(), expected, TreeNode.treeDef(), actual).mapToSame(TreeNode::getContent, TreeNode::getContent); } }