@Test
public void testGetEntities() throws Exception {

  Smil smil = new SmilImpl();
  SmilResponse response = new SmilResponseImpl(smil);
  try {
    response.getEntities();
    fail("getEntities should fail, if entity count is zero");
  } catch (SmilException ex) {
  }
  response = new SmilResponseImpl(smil, smil.getBody());
  try {
    SmilObject[] entities = response.getEntities();
    assertSame(1, entities.length);
    assertSame(smil.getBody(), entities[0]);
  } catch (SmilException ex) {
    fail("getEntities should not throw an Exception if some entities are set");
  }
  response = new SmilResponseImpl(smil, new SmilObject[]{smil.getHead(), smil.getBody()});
  try {
    SmilObject[] entities = response.getEntities();
    assertSame(2, entities.length);
    assertSame(smil.getHead(), entities[0]);
    assertSame(smil.getBody(), entities[1]);
  } catch (SmilException ex) {
    fail("getEntities should not throw an Exception if some entities are set");
  }
}