code: public synchronized TransactionItem[] clear()
      {
      	// Create snapshot
      	TransactionItem[] itemsSnapshot = items.toArray(new TransactionItem[items.size()]);
     	
      	// Clear
      	items.clear();
      	
      	return itemsSnapshot;
      }
docs: Clear the set and return a snapshot of its content