private void internalAddHead(final MessageReference ref){
  queueMemorySize.addAndGet(ref.getMessageMemoryEstimate());
  refAdded(ref);
  int priority=getPriority(ref);
  messageReferences.addHead(ref,priority);
}

private void internalAddHead ( final MessageReference ref ) { queueMemorySize . addAndGet ( ref . getMessageMemoryEstimate ( ) ) ; refAdded ( ref ) ; int priority = getPriority ( ref ) ; messageReferences . addHead ( ref , priority ) ; }
the caller of this method requires synchronized on the queue . i ' m not going to add synchronized to this method just for a precaution , as i ' m not 100 % sure this won ' t cause any extra runtime .
