Community
Chat Logs
Tuesday, July 7, 2026
- acidjnknvm, extract that one method, and it's fine
- * Fiji_ joined #java
- * Nnnavd joined #java
- * ChaiTRex joined #java
- jreicheracidjnk: I'm not sure syntax is your problem there. Why are you flatmapping onto a lambda that produces a stream?
- * m joined #java
- * jamezp joined #java
- * Odyss3us joined #java
- * ForeverDreaming joined #java
- * michele joined #java
- * stfstfm joined #java
- * ferdna joined #java
- * stfstfm joined #java
- * domicron6 joined #java
- * Gaz7051122720067 joined #java
- * rvalue joined #java
- * kusanagi joined #java
- * taylan joined #java
- * Afroboy joined #java
- * leppard joined #java
- * mindCrime joined #java
- * Maxxed joined #java
- * stfstfm joined #java
- * yeahitsme joined #java
- * jwisbell35 joined #java
- * acidjnk joined #java
- * leppard joined #java
- * Skynx joined #java
- * MikeBux joined #java
- * leppard joined #java
- * airaqi joined #java
- * airaqi joined #java
- * erbium joined #java
- acidjnkthe logic is correct jreicher, but it shows that readability is not good enough yet, although I also did not provide all the context. I ended up making this utility method, surprised that it did not exist in the core API yet. It's like zip, but cartesian instead of pair-wise: https://pastebin.com/UxGdLa8t
- * stfstfm joined #java
- * Betal joined #java
- dreamrealacidjnk: what id this trying to do?
- * stfstfm joined #java
- acidjnkWhat I'm using it for is a JUnit DynamicTest and @TestFactory. I have a list of first arguments, a list of second arguments, and need to call a parameterized test with all possible combinations. Some JUnit library has a @Cartesian annotation or something like that with similar effect.
- ParaCartesian product as a stream assumes extrapolating a two-dimensional result from a sequence. That's not very generalizable -> no method in API.
- ParaAs a group of operations that's zip + reduce, though. I don't think n-stream zipper exists in core API either.
- Para(per dimension)
- dreamrealpara's right, I actually use a set of nested values in a methodsource to do it: for(var v1 :setOfV1s) { for(var v2: setofV2) { ... compose set here } }
- Parathis guy's done a pretty good zipping gatherer https://www.morling.dev/blog/zipping-gatherer/
- javabotPara's title: "A Zipping Gatherer - Gunnar Morling"
- ParaHm, I think I've seen this SO post before :) https://stackoverflow.com/questions/17640754/zipping-streams-using-jdk8-with-lambda-java-util-stream-streams-zip
- javabotPara's title: "functional programming - Zipping streams using JDK8 with lambda (java.util.stream.Streams.zip) - Stack Overflow"
- acidjnkjOOλ has something similar, but as two calls. It has a crossjoin to create the tuples, and then it's just mapping to a BiFunction. I was considering to just use that as a library.
- * dreamreal shrugs. Do what works for you.
- acidjnkwhen you can use methodsource, @CartesianTest would also work: https://junit-pioneer.org/docs/cartesian-product/ Mine can't use method source, because it is abstract, and I need the elements defined by the corresponding implementations.
- nevetCartesian Product of Parameters
- dreamrealoooo I need to look at that, I've been doing it manually
- dreamrealI keep thinking junit's just not all that flexible, people keep adding it.
- dreamrealoh, of course, that's not junit proper, that's why
- acidjnkyes. I looked at all sorts of alternatives before I resorted to @TestFactory
- * GreenResponse joined #java
- * leppard joined #java
- jreicheracidjnk: I never said the logic was wrong. I'm asking why you've chosen to implement it using this combination of operations.
- * sonOfRa_ joined #java
- * jamezp joined #java
- * ForeverDreaming joined #java
- acidjnkReasonable question, but from the question itself I concluded: Ok, it's not obvious that I want to call a method with all possible combinations of the elements from the two sources.
- * Afroboy joined #java
- * mindCrime joined #java
- * metalmaniac joined #java
- * Anaphaxeton joined #java
- * leppard|2 joined #java
- * Fiji_ joined #java
- * ChaiTRex joined #java
- * WizJin joined #java
- * ferdna joined #java
- * stfstfm joined #java
- * acidsys joined #java
- * acidsys joined #java
- * hwpplayer1 joined #java
- * Anaphaxaway joined #java
- * Ragnor joined #java
- * domicron joined #java
- * stfstfm_ joined #java
- * hwpplayer1 joined #java
- * jbosmans joined #java
- * sonOfRa joined #java
- * domicron1 joined #java
- * monkeyPlus joined #java
- * ernimril joined #java
- * metalmaniac joined #java
- * acidjnk_new joined #java
- * jreicher joined #java
- * jamezp joined #java
- * Fiji_ joined #java
- * Odyss3us joined #java