@Test
public void wash() throws Exception {

  WashingMachine washingMachine = new WashingMachine();
  ExecutorService executorService = Executors.newFixedThreadPool(2);
  executorService.execute(washingMachine::wash);
  executorService.execute(() -> {
    washingMachine.wash();
    machineStateGlobal = washingMachine.getWashingMachineState();
  });
  executorService.shutdown();
  try {
    executorService.awaitTermination(10, TimeUnit.SECONDS);
  } catch (InterruptedException ie) {
    ie.printStackTrace();
  }
  assertEquals(WashingMachineState.WASHING, machineStateGlobal);
}