@Test
public void getMessageUnitsWithId() throws PersistenceException {

    // Just one result
    Collection<IMessageUnitEntity>   result =  queryManager.getMessageUnitsWithId(TestData.userMsg1.getMessageId());
    assertFalse(Utils.isNullOrEmpty(result));
    assertEquals(1 , result.size());
    // Test no result
    result = queryManager.getMessageUnitsWithId("non-existing-msgid");
    assertTrue(Utils.isNullOrEmpty(result));
    // Test with multiple results of same type
    result = queryManager.getMessageUnitsWithId(TestData.receipt2.getMessageId());
    assertFalse(Utils.isNullOrEmpty(result));
    assertEquals(3 , result.size());
    
    // Test with optional direction indicator 
    result = queryManager.getMessageUnitsWithId(TestData.receipt2.getMessageId(), Direction.OUT);
    assertFalse(Utils.isNullOrEmpty(result));
    assertEquals(1 , result.size());
    // Test with multiple results of different type
    result = queryManager.getMessageUnitsWithId(TestData.error4.getMessageId());
    assertFalse(Utils.isNullOrEmpty(result));
    assertEquals(2 , result.size());
}