ShapedDataSource implements ExtendedRandomnessSource { Precursor capturedPrecursor() { return precursor; } ShapedDataSource(PseudoRandom r, long[] forced, int maxTries); @Override long next(Constraint constraints); @Override long tryNext(Constraint constraints); @Override void registerFailedAssumption(); @Override DetatchedRandomnessSource detach(); void add(Precursor other);  }
@Test public void onlyCapturesPrecursorsThatPassCompoundAssumptions() { Gen<Pair<Long,Long>> joined = Generate.longRange(0l, 5l) .assuming(l -> l != 3) .map((a,b) -> Pair.of(a,b) ) .assuming( p -> p._1 == 2) .assuming( p -> p._2 != 0); Pair<Long, Long> value = joined.generate(testee); assertThat(testee.capturedPrecursor().current()).containsExactly(value._1, value._2); }