use of javaslang.collection.CharSeq in project javaslang by javaslang.
the class CharSeqTest method shouldInsertIntoSeq.
@Test
public void shouldInsertIntoSeq() {
final CharSeq actual = of('1', '2', '3').insert(2, '4');
final CharSeq expected = of('1', '2', '4', '3');
assertThat(actual).isEqualTo(expected);
}
use of javaslang.collection.CharSeq in project javaslang by javaslang.
the class CharSeqTest method shouldLeftPadNonEmptyZeroLen.
@Test
public void shouldLeftPadNonEmptyZeroLen() {
final CharSeq seq = of('a');
assertThat(seq.leftPadTo(0, 'b')).isSameAs(seq);
}
use of javaslang.collection.CharSeq in project javaslang by javaslang.
the class CharSeqTest method shouldPrependAllNilToNil.
@Test
public void shouldPrependAllNilToNil() {
final CharSeq actual = empty().prependAll(empty());
final CharSeq expected = empty();
assertThat(actual).isEqualTo(expected);
}
use of javaslang.collection.CharSeq in project javaslang by javaslang.
the class CharSeqTest method shouldReturnNilWhenIndicesBothAreUpperBound.
@Test
public void shouldReturnNilWhenIndicesBothAreUpperBound() {
final CharSeq actual = of('1', '2', '3').subSequence(3, 3);
assertThat(actual).isSameAs(empty());
}
use of javaslang.collection.CharSeq in project javaslang by javaslang.
the class Euler36Test method isDoubleBasePalindrome.
private static boolean isDoubleBasePalindrome(int x) {
final CharSeq seq = CharSeq.of(Integer.toString(x));
final CharSeq rev = CharSeq.of(Integer.toBinaryString(x));
return isPalindrome(seq) && isPalindrome(rev);
}
Aggregations