public static DocumentPath leastCommonAncestor ( Collection < DocumentPath > paths ) { if ( paths . isEmpty ( ) ) { return null ; } return DocumentPath . from ( StringUtils . getCommonPrefix ( paths . stream ( ) . map ( DocumentPath :: toString ) . toArray ( String [ ] :: new ) ) ) ; }
Returns the path that points to the least common ancestor of the specified collection of paths .