Add spec of PatternUtil, remove unused method from PatternUtil.