@startuml
package com.iluwatar.abstractdocument.domain {
  class Car {
    + Car(properties : Map<String, Object>)
  }
  interface HasModel {
    + PROPERTY : String {static}
    + getModel() : Optional<String>
  }
  interface HasParts {
    + PROPERTY : String {static}
    + getParts() : Stream<Part>
  }
  interface HasPrice {
    + PROPERTY : String {static}
    + getPrice() : Optional<Number>
  }
  interface HasType {
    + PROPERTY : String {static}
    + getType() : Optional<String>
  }
  class Part {
    + Part(properties : Map<String, Object>)
  }
}
package com.iluwatar.abstractdocument {
  abstract class AbstractDocument {
    - properties : Map<String, Object>
    # AbstractDocument(properties : Map<String, Object>)
    + children(key : String, constructor : Function<Map<String, Object>, T>) : Stream<T>
    + get(key : String) : Object
    + put(key : String, value : Object)
    + toString() : String
  }
  class App {
    - LOGGER : Logger {static}
    + App()
    + main(args : String[]) {static}
  }
  interface Document {
    + children(String, Function<Map<String, Object>, T>) : Stream<T> {abstract}
    + get(String) : Object {abstract}
    + put(String, Object) {abstract}
  }
}
AbstractDocument ..|> Document 
Car ..|> HasModel 
Car ..|> HasPrice 
Car ..|> HasParts 
Car --|> AbstractDocument 
HasModel --|> Document 
HasParts --|> Document 
HasPrice --|> Document 
HasType --|> Document 
Part ..|> HasType 
Part ..|> HasModel 
Part ..|> HasPrice 
Part --|> AbstractDocument 
@enduml