/** * count code points. */ @Test public void countCodePoints() { Consumer<String> tester = s -> assertThat( StringOptionUtil.countCodePoints(new StringOption(s)), is((int) s.codePoints().count())); tester.accept(""); tester.accept("a"); tester.accept("Hello, world!"); tester.accept("\u00c0"); tester.accept(StringOptionTest.HELLO_JP); tester.accept(new StringBuilder() .appendCodePoint(0x1f37a) .appendCodePoint(0x1f363) .toString()); }