private static ArrayList<GridCollisionJobContextWrapper> slice(Collection<CollisionJobContext> src,int num){
  ArrayList<GridCollisionJobContextWrapper> slice=new ArrayList<>();
  Iterator<CollisionJobContext> iter=src.iterator();
  for (int i=0; i < num && iter.hasNext(); i++)   slice.add(new GridCollisionJobContextWrapper(iter.next(),i));
  return slice;
}

private static ArrayList < GridCollisionJobContextWrapper > slice ( Collection < CollisionJobContext > src , int num ) { ArrayList < GridCollisionJobContextWrapper > slice = new ArrayList < > ( ) ; Iterator < CollisionJobContext > iter = src . iterator ( ) ; for ( int i = 0 ; i < num && iter . hasNext ( ) ; i ++ ) slice . add ( new GridCollisionJobContextWrapper ( iter . next ( ) , i ) ) ; return slice ; }
takes first n element from contexts list , wrap them and put it into a new list .
