public void wash() {
    synchronized (this) {
      var machineState = getWashingMachineState();
      LOGGER.info("{}: Actual machine state: {}", Thread.currentThread().getName(), machineState);
      if (this.washingMachineState == WashingMachineState.WASHING) {
        LOGGER.error("Cannot wash if the machine has been already washing!");
        return;
      }
      this.washingMachineState = WashingMachineState.WASHING;
    }
    LOGGER.info("{}: Doing the washing", Thread.currentThread().getName());

    this.delayProvider.executeAfterDelay(50, TimeUnit.MILLISECONDS, this::endOfWashing);
  }
@Test
  void wash() {
    var washingMachine = new WashingMachine(fakeDelayProvider);

    washingMachine.wash();
    washingMachine.wash();

    var machineStateGlobal = washingMachine.getWashingMachineState();

    fakeDelayProvider.task.run();

    // washing machine remains in washing state
    assertEquals(WashingMachineState.WASHING, machineStateGlobal);

    // washing machine goes back to enabled state
    assertEquals(WashingMachineState.ENABLED, washingMachine.getWashingMachineState());
  }