I am trying to get certain integers, all which I am getting over the stream, however, they are essentially being added to a new stream of integers which I will be using later on.
To populate the new stream of integers, I make multiple IntStreams and then append them to a new one using the IntStream builder, as such:
Is there a better way to approach this:
IntStream rightSide = IntStream.range(8, this.rows.getSlotAmount()).map(value -> value + 9);
IntStream leftSide = IntStream.range(0, this.rows.getSlotAmount()).map(value -> value % 9);
IntStream top = IntStream.range(0, 9);
IntStream bottom = IntStream.range(this.rows.getSlotAmount() - 9, this.rows.getSlotAmount());
IntStream.Builder slots = IntStream.builder();
rightSide.forEach(slots::add);
leftSide.forEach(slots::add);
top.forEach(slots::add);
bottom.forEach(slots::add);
slots.build().forEach(this::methodReference);