Included commonSubstrings method and tests