StringPattern { public boolean containsHyphen() { return (pattern & CONTAINS_HYPHEN) > 0; } private  StringPattern(int pattern, int digits); boolean isAllLetter(); boolean isInitialCapitalLetter(); boolean isAllCapitalLetter(); boolean isAllLowerCaseLetter(); boolean isAllDigit(); int digits(); boolean containsPeriod(); boolean containsComma(); boolean containsSlash(); boolean containsDigit(); boolean containsHyphen(); boolean containsLetters(); static StringPattern recognize(String token);  }
@Test public void testContainsHyphen() { assertTrue(StringPattern.recognize("test--").containsHyphen()); assertTrue(StringPattern.recognize("23-5").containsHyphen()); assertFalse(StringPattern.recognize("test.1/,").containsHyphen()); }