@startuml
package com.iluwatar.prototype {
  class App {
    - LOGGER : Logger {static}
    + App()
    + main(args : String[]) {static}
  }
  abstract class Beast {
    + Beast()
    + clone() : Beast {abstract}
  }
  class ElfBeast {
    + ElfBeast()
    + clone() : Beast
    + toString() : String
  }
  class ElfMage {
    + ElfMage()
    + clone() : Mage
    + toString() : String
  }
  class ElfWarlord {
    + ElfWarlord()
    + clone() : Warlord
    + toString() : String
  }
  interface HeroFactory {
    + createBeast() : Beast {abstract}
    + createMage() : Mage {abstract}
    + createWarlord() : Warlord {abstract}
  }
  class HeroFactoryImpl {
    - beast : Beast
    - mage : Mage
    - warlord : Warlord
    + HeroFactoryImpl(mage : Mage, warlord : Warlord, beast : Beast)
    + createBeast() : Beast
    + createMage() : Mage
    + createWarlord() : Warlord
  }
  abstract class Mage {
    + Mage()
    + clone() : Mage {abstract}
  }
  class OrcBeast {
    + OrcBeast()
    + clone() : Beast
    + toString() : String
  }
  class OrcMage {
    + OrcMage()
    + clone() : Mage
    + toString() : String
  }
  class OrcWarlord {
    + OrcWarlord()
    + clone() : Warlord
    + toString() : String
  }
  abstract class Prototype {
    + Prototype()
    + clone() : Object {abstract}
  }
  abstract class Warlord {
    + Warlord()
    + clone() : Warlord {abstract}
  }
}
HeroFactoryImpl -->  "-beast" Beast
HeroFactoryImpl -->  "-warlord" Warlord
HeroFactoryImpl -->  "-mage" Mage
Beast --|> Prototype 
ElfBeast --|> Beast 
ElfMage --|> Mage 
ElfWarlord --|> Warlord 
HeroFactoryImpl ..|> HeroFactory 
Mage --|> Prototype 
OrcBeast --|> Beast 
OrcMage --|> Mage 
OrcWarlord --|> Warlord 
Warlord --|> Prototype 
@enduml