class Writer implements Runnable {

  private final Lock writeLock;

  private final String name;

  private final long writingTime;

  /**
   * Create new Writer who writes for 250ms.
   *
   * @param name      - Name of the thread owning the writer
   * @param writeLock - Lock for this writer
   */
  public Writer(String name, Lock writeLock) {
    this(name, writeLock, 250L);
  }

  /**
   * Create new Writer.
   *
   * @param name        - Name of the thread owning the writer
   * @param writeLock   - Lock for this writer
   * @param writingTime - amount of time (in milliseconds) for this reader to engage writing
   */
  public Writer(String name, Lock writeLock, long writingTime) {
    this.name = name;
    this.writeLock = writeLock;
    this.writingTime = writingTime;
  }


  @Override
  public void run() {<FILL_FUNCTION_BODY>}

  /**
   * Simulate the write operation.
   */
  public void write() throws InterruptedException {
    LOGGER.info("{} begin", name);
    Thread.sleep(writingTime);
    LOGGER.info("{} finished after writing {}ms", name, writingTime);
  }
}

    writeLock.lock();
    try {
      write();
    } catch (InterruptedException e) {
      LOGGER.info("InterruptedException when writing", e);
      Thread.currentThread().interrupt();
    } finally {
      writeLock.unlock();
    }
  
<no_super_class>