@Test
public void testGetEntity() throws Exception {

  Smil smil = new SmilImpl();
  SmilResponse response = new SmilResponseImpl(smil);
  try {
    response.getEntity();
    fail("getEntity should fail, if entity count is zero");
  } catch (SmilException ex) {
  }
  response = new SmilResponseImpl(smil, smil.getBody());
  try {
    assertSame(smil.getBody(), response.getEntity());
    assertSame(1, response.getEntities().length);
    assertSame(smil.getBody(), response.getEntities()[0]);
  } catch (SmilException ex) {
    fail("getEntity should return the entity");
  }
  response = new SmilResponseImpl(smil, new SmilObject[]{smil.getHead(), smil.getBody()});
  try {
    response.getEntity();
    fail("get entity should fail if there are more then one entities set.");
  } catch (SmilException ex) {
  }
}