@startuml
package com.iluwatar.reader.writer.lock {
  class App {
    - LOGGER : Logger {static}
    + App()
    + main(args : String[]) {static}
  }
  class Reader {
    - LOGGER : Logger {static}
    - name : String
    - readLock : Lock
    + Reader(name : String, readLock : Lock)
    + read()
    + run()
  }
  class ReaderWriterLock {
    - currentReaderCount : int
    - globalMutex : Set<Object>
    - readerLock : ReadLock
    - readerMutex : Object
    - writerLock : WriteLock
    + ReaderWriterLock()
    - doesReaderOwnThisLock() : boolean
    - doesWriterOwnThisLock() : boolean
    - isLockFree() : boolean
    + readLock() : Lock
    - waitUninterruptibly(o : Object) {static}
    + writeLock() : Lock
  }
  -class ReadLock {
    - ReadLock()
    + lock()
    + lockInterruptibly()
    + newCondition() : Condition
    + tryLock() : boolean
    + tryLock(time : long, unit : TimeUnit) : boolean
    + unlock()
  }
  -class WriteLock {
    - WriteLock()
    + lock()
    + lockInterruptibly()
    + newCondition() : Condition
    + tryLock() : boolean
    + tryLock(time : long, unit : TimeUnit) : boolean
    + unlock()
  }
  class Writer {
    - LOGGER : Logger {static}
    - name : String
    - writeLock : Lock
    + Writer(name : String, writeLock : Lock)
    + run()
    + write()
  }
}
ReaderWriterLock -->  "-readerLock" ReadLock
ReadLock --+ ReaderWriterLock
ReaderWriterLock -->  "-writerLock" WriteLock
WriteLock --+ ReaderWriterLock
@enduml