This needs to be completed so that the code in MessageManager can be tested.