public Element simulate(final List<Instruction> instructions){
  lock.lock();
  try {
    returnElement=null;
    return simulateInternal(instructions);
  }
  finally {
    lock.unlock();
  }
}

public Element simulate ( final List < Instruction > instructions ) { lock . lock ( ) ; try { returnElement = null ; return simulateInternal ( instructions ) ; } finally { lock . unlock ( ) ; } }
simulates the instructions and collects information about the resource method .
