Antonio Addeo
Antonio Addeo
Hi, what if there was a Supplier in insertInStream signature? ```java public Stream insertInStream(Supplier supplier, T elem, int index) { Stream limited = supplier.get().limit(index); Stream skipped = supplier.get().skip(index + 1);...
I came up with this solution without affecting the method signature ```java private static Stream insertInStream(Stream stream, T elem, int index) { Iterator iterator = stream.iterator(); return Stream.concat(Stream.concat( Stream.generate(iterator::next).limit(index), Stream.of(elem)),...
It seems that ```Stream.generate(iterator::next)``` won't let it work for finite streams. I had to adjust it like below ```java return Stream.concat(Stream.concat( Stream.generate(iterator::next).limit(index), Stream.of(elem)), StreamSupport.stream( Spliterators.spliteratorUnknownSize(iterator, /* characteristics= */ 0), /*...
Hi, I implemented three snippets of the Damm algorithm validation. 1. Traditional for loop ```java boolean damm(String s) { int row = 0; for (int i = 0; i <...
Hi @Saravana-PS, the issue required a simple fix, there's not much else to do
Hi @iluwatar, can I work on this issue?
Thanks for assigning me this issue. My implementation idea is based on the use of method chaining in a hierarchy of objects like in the link example
I've included a new example that was inspired by an example from Effective Java. These examples can be found in the [space](https://github.com/AddeusExMachina/java-design-patterns/tree/crtp/crtp/src/main/java/crtp/space) and [fight](https://github.com/AddeusExMachina/java-design-patterns/tree/crtp/crtp/src/main/java/crtp/fight) packages respectively. Please let me know...
@jaswanthg76 https://github.com/iluwatar/java-design-patterns/wiki/01.-How-to-contribute
Hi @vatsasiddhartha, the problem has actually been solved and the fix has been merged