@Test void testCount() throws Exception { String str; int expectedLength; str = "a quick brown fox jumped over the lazy dog."; expectedLength = str.length(); assertEquals(expectedLength, CharacterUtil.count(str)); str = "café"; expectedLength = 4; assertEquals(expectedLength, CharacterUtil.count(str)); assertFalse(CharacterUtil.isExceedingLengthLimitation(str)); str = "cafe"; expectedLength = 4; assertEquals(expectedLength, CharacterUtil.count(str)); assertFalse(CharacterUtil.isExceedingLengthLimitation(str)); str = "０１２３４５６７８９０１２３４５６７８９０１２３４５６７８９０１２３４５６７８９０１２３４５６７８９０１２３４５６７８９０１２３４５６７８９０１２３４５６７８９０１２３４５６７８９０１２３４５６７８９０１２３４５６７８９０１２３４５６７８９０１２３４５６７８９０１２３４５６７８９"; expectedLength = 140; assertEquals(expectedLength, CharacterUtil.count(str)); assertFalse(CharacterUtil.isExceedingLengthLimitation(str)); str = "０１２３４５６７８９０１２３４５６７８９０１２３４５６７８９０１２３４５６７８９０１２３４５６７８９０１２３４５６７８９０１２３４５６７８９０１２３４５６７８９０１２３４５６７８９０１２３４５６７８９０１２３４５６７８９０１２３４５６７８９０１２３４５６７８９０１２３４５６７８９０"; expectedLength = 141; assertEquals(expectedLength, CharacterUtil.count(str)); assertFalse(CharacterUtil.isExceedingLengthLimitation(str)); str = "０１２３４５６７８９０１２３４５６７８９０１２３４５６７８９０１２３４５６７８９０１２３４５６７８９０１２３４５６７８９０１２３４５６７８９０１２３４５６７８９０１２３４５６７８９０１２３４５６７８９０１２３４５６７８９０１２３４５６７８９０１２３４５６７８９０１２３４５66778899"; expectedLength = 144; assertEquals(expectedLength, CharacterUtil.count(str)); assertFalse(CharacterUtil.isExceedingLengthLimitation(str)); str = "０１２３４５６７８９０１２３４５６７８９０１２３４５６７８９０１２３４５６７８９０１２３４５６７８９０１２３４５６７８９０１２３４５６７８９０１２３４５６７８９０１２３４５６７８９０１２３４５６７８９０１２３４５６７８９０１２３４５６７８９０１２３４５６７８９０１２３４５６７８９０１２３４５６７８９０１２３４５６７８９０１２３４５６７８９０１２３４５６７８９０１２３４５６７８９０１２３４５６７８９０１２３４５６７８９０１２３４５６７８９０１２３４５６７８９０１２３４５６７８９０１２３４５６７８９０１２３４５６７８９０１２３４５６７８９０１２３４５６７８９"; expectedLength = 280; assertEquals(expectedLength, CharacterUtil.count(str)); assertFalse(CharacterUtil.isExceedingLengthLimitation(str)); str = "０１２３４５６７８９０１２３４５６７８９０１２３４５６７８９０１２３４５６７８９０１２３４５６７８９０１２３４５６７８９０１２３４５６７８９０１２３４５６７８９０１２３４５６７８９０１２３４５６７８９０１２３４５６７８９０１２３４５６７８９０１２３４５６７８９０１２３４５６７８９０１２３４５６７８９０１２３４５６７８９０１２３４５６７８９０１２３４５６７８９０１２３４５６７８９０１２３４５６７８９０１２３４５６７８９０１２３４５６７８９０１２３４５６７８９０１２３４５６７８９０１２３４５６７８９０１２３４５６７８９０１２３４５６７８９０１２３４５６７８９0"; expectedLength = 281; assertEquals(expectedLength, CharacterUtil.count(str)); assertTrue(CharacterUtil.isExceedingLengthLimitation(str)); str = "０１２３４５６７８９０１２３４５６７８９０１２３４５６７８９０１２３４５６７８９０１２３４５６７８９０１２３４５６７８９０１２３４５６７８９０１２３４５６７８９０１２３４５６７８９０１２３４５６７８９０１２３４５６７８９０１２３４５６７８９０１２３４５６７８９０１２３４５６７８９０１２３４５６７８９０１２３４５６７８９０１２３４５６７８９０１２３４５６７８９０１２３４５６７８９０１２３４５６７８９０１２３４５６７８９０１２３４５６７８９０１２３４５６７８９０１２３４５６７８９０１２３４５６７８９０１２３４５６７８９０１２３４５６７８９０１２３４５６７８９0123"; expectedLength = 284; assertEquals(expectedLength, CharacterUtil.count(str)); assertTrue(CharacterUtil.isExceedingLengthLimitation(str)); }
public static int count(String text) { return text.length(); }
CharacterUtil { public static int count(String text) { return text.length(); } }
CharacterUtil { public static int count(String text) { return text.length(); } private  CharacterUtil(); }
CharacterUtil { public static int count(String text) { return text.length(); } private  CharacterUtil(); static int count(String text); static boolean isExceedingLengthLimitation(String text); }
CharacterUtil { public static int count(String text) { return text.length(); } private  CharacterUtil(); static int count(String text); static boolean isExceedingLengthLimitation(String text); static final int MAX_TWEET_LENGTH; }