use of org.eclipse.collections.impl.string.immutable.CodePointAdapter in project eclipse-collections by eclipse.
the class StringsTest method asCodePoints.
@Test
public void asCodePoints() {
CodePointAdapter adapter = Strings.asCodePoints("The quick brown fox jumps over the lazy dog.");
Assert.assertTrue(adapter.contains((int) 'T'));
}
use of org.eclipse.collections.impl.string.immutable.CodePointAdapter in project eclipse-collections by eclipse.
the class StringsTest method toCodePoints.
@Test
public void toCodePoints() {
CodePointAdapter adapter = Strings.toCodePoints((int) 'H', (int) 'e', (int) 'l', (int) 'l', (int) 'o');
Assert.assertEquals(2, adapter.count(i -> i == (int) 'l'));
}
use of org.eclipse.collections.impl.string.immutable.CodePointAdapter in project eclipse-collections by eclipse.
the class StringIterateTest method asCodePointAdapter.
@Test
public void asCodePointAdapter() {
CodePointAdapter answer = StringIterate.asCodePointAdapter("HelloHellow").collectInt(Character::toUpperCase).select(i -> i != 'W').distinct().toReversed().reject(CodePointAdapter.adapt("LE")::contains).newWith('!');
Assert.assertEquals("OH!", answer.toString());
Assert.assertEquals("OH!", answer.toStringBuilder().toString());
Assert.assertEquals("OH!", answer.makeString(""));
IntList intList = StringIterate.asCodePointAdapter("HelloHellow").asLazy().collectInt(Character::toUpperCase).select(i -> i != 'W').toList().distinct().toReversed().reject(CodePointAdapter.adapt("LE")::contains).with('!');
Assert.assertEquals("OH!", CodePointAdapter.from(intList).toString());
Assert.assertEquals("OH!", CodePointAdapter.from(CodePointAdapter.from(intList)).toString());
}
Aggregations