public void insert(Transaction transaction){
  LOG.debug("about to insert: " + transaction);
  if (!transaction.isEmpty()) {
    List<Transaction> tail=new ArrayList<>(mTransactions.size() + 2);
    mTransactions.drainTo(tail);
    mTransactions.add(transaction);
    mTransactions.addAll(tail);
  }
}

public void insert ( Transaction transaction ) { LOG . debug ( "about to insert: " + transaction ) ; if ( ! transaction . isEmpty ( ) ) { List < Transaction > tail = new ArrayList < > ( mTransactions . size ( ) + 2 ) ; mTransactions . drainTo ( tail ) ; mTransactions . add ( transaction ) ; mTransactions . addAll ( tail ) ; } }
adds a transaction to the beginning of the queue . note that actions of the * currently executing * transaction will still be executed before the given transaction .
