question: private int nextAvailableIdx ( Collection < Integer > startedGrids , int maxTopSize , Random rnd ) { while ( true ) { int idx = rnd . nextInt ( maxTopSize ) ; if ( ! startedGrids . contains ( idx ) ) return idx ; } }
target:  Gets next available index.