public void testValidateDirectElimination() {
    EntityManager em = createEntityManager();

    Elimination directElimination = em.find(Elimination.class, directEliminationPK);
    assertNotNull("The direct elimination could not be read back.", directElimination);
    assertTrue(
        "The elimination was not a direct elimination", directElimination.isDirectElimination());

    // Validate the weapon that was used for the direct elimination.
    Weapon weapon = ((DirectElimination) directElimination).getDirectWeapon();
    assertNotNull("The direct elimination's weapon was null", weapon);
    assertTrue("The direct elimination's weapon was not a direct weapon", weapon.isDirectWeapon());
    assertTrue("The direct elimination's weapon was not a gun", ((DirectWeapon) weapon).isGun());

    closeEntityManager(em);
  }
  public void testValidateIndirectElimination() {
    EntityManager em = createEntityManager();

    Elimination indirectElimination = em.find(Elimination.class, indirectEliminationPK);
    assertNotNull("The indirect elimination could not be read back.", indirectElimination);
    assertTrue(
        "The elimination was not an idirect elimination",
        indirectElimination.isIndirectElimination());

    // Validate the weapon that was used for the direct elimination.
    Weapon weapon = ((IndirectElimination) indirectElimination).getIndirectWeapon();
    assertNotNull("The indirect elimination's weapon was null", weapon);
    assertTrue(
        "The indirect elimination's weapon was not an idirect weapon", weapon.isIndirectWeapon());
    assertTrue(
        "The indirect elimination's weapon was not a bomb", ((IndirectWeapon) weapon).isBomb());

    closeEntityManager(em);
  }