@Override
  public UnitExtension getUnitExtension(String extensionName) {

    if (extensionName.equals("SoldierExtension")) {
      return Optional.ofNullable(unitExtension).orElseGet(() -> new Soldier(this));
    }

    return super.getUnitExtension(extensionName);
  }
@Test
  void getUnitExtension() {
    final var unit = new SoldierUnit("SoldierUnitName");

    assertNotNull(unit.getUnitExtension("SoldierExtension"));
    assertNull(unit.getUnitExtension("SergeantExtension"));
    assertNull(unit.getUnitExtension("CommanderExtension"));
  }