public synchronized MessageReference removeReferenceWithID(final long id) throws Exception
{
Iterator<MessageReference> iterator = iterator();
MessageReference removed = null;
while (iterator.hasNext())
{
MessageReference ref = iterator.next();
if (ref.getMessage().getMessageID() == id)
{
iterator.remove();
refRemoved(ref);
removed = ref;