public <T>List<T> testTwoThreadsOneItem(T a,T b){
  Trace.trace(Item.SCHEDULER,"testTwoThreadsOneItem: in");
  List<T> results=Collections.synchronizedList(new ArrayList<T>(2));
  Scheduler.scheduleMutator(new TestMutator<T>(results,a));
  Scheduler.scheduleMutator(new TestMutator<T>(results,b));
  Scheduler.schedule();
  Trace.trace(Item.SCHEDULER,"testTwoThreadsOneItem: out");
  return results;
}

public < T > List < T > testTwoThreadsOneItem ( T a , T b ) { Trace . trace ( Item . SCHEDULER , "testTwoThreadsOneItem: in" ) ; List < T > results = Collections . synchronizedList ( new ArrayList < T > ( 2 ) ) ; Scheduler . scheduleMutator ( new TestMutator < T > ( results , a ) ) ; Scheduler . scheduleMutator ( new TestMutator < T > ( results , b ) ) ; Scheduler . schedule ( ) ; Trace . trace ( Item . SCHEDULER , "testTwoThreadsOneItem: out" ) ; return results ; }
two threads insert a single item each into the result list < p > expected result : a list containing the two items in a policy / scheduler - dependent order .
