RepeatUntilBlock implements Block { @Override public PieceCount getPieceCount() { return PieceCount.createUnknownCount(); } RepeatUntilBlock(
      int repeatTimes, Block block, Supplier<Boolean> toQuit); static Block unlimited(Block block, Supplier<Boolean> toQuit); @Override Iterator<AbstractPiece> iterator(); @Override void forAllPossiblePieces(Consumer<AbstractPiece> consumer); @Override PieceCount getPieceCount(); @Override String toString();  }
@Test public void testRepeatUntilBlockBasic() throws Exception { Piece piece1 = new Piece(); Piece piece2 = new Piece(); Block innerBlock = new SequenceBlock(piece1, piece2); Block repeatBlock = new RepeatUntilBlock( REPEAT_TIMES, innerBlock, falseSupplier ); BlockTestingUtils.testIndependence( Iterables.concat(Collections.nCopies(REPEAT_TIMES, Arrays.asList(piece1, piece2))), repeatBlock); Assert.assertEquals(2, innerBlock.getPieceCount().getCount()); Assert.assertFalse(repeatBlock.getPieceCount().isKnown()); }