@Override default Stream<T> dropRight(int n) { if (n <= 0) { return this; } else { return DropRight.apply(take(n).toList(), List.empty(), drop(n)); } }
@Override default Stream<T> dropRight(int n) { if (n <= 0) { return this; } else { return DropRight.apply(take(n).toList(), List.empty(), drop(n)); } }
private List<Integer> indexesOfInvalidParityBits(EncodedString input) { return Stream.iterate(1, i -> i * 2) .takeWhile(it -> it < input.getValue().length()) .filter(it -> helper.parityIndicesSequence(it - 1, input.getValue().length()) .map(v -> toBinaryInt(input, v)) .fold(toBinaryInt(input, it - 1), (a, b) -> a ^ b) != 0) .toList(); }