private List<Integer> muxToList(PageResultMultiplexer<Integer> mux) throws InterruptedException, IOException {
  Integer n;
  List<Integer> list=new ArrayList<>();
  while (true) {
    if ((n=mux.next()) == null) {
      break;
    }
    list.add(n);
  }
  return list;
}

private List < Integer > muxToList ( PageResultMultiplexer < Integer > mux ) throws InterruptedException , IOException { Integer n ; List < Integer > list = new ArrayList < > ( ) ; while ( true ) { if ( ( n = mux . next ( ) ) == null ) { break ; } list . add ( n ) ; } return list ; }
helper function , fully consume multiplexer output into a list ( blocking ) .
