class DwarvenMineWorker {

  public void goToSleep() {
    LOGGER.info("{} goes to sleep.", name());
  }

  public void wakeUp() {
    LOGGER.info("{} wakes up.", name());
  }

  public void goHome() {
    LOGGER.info("{} goes home.", name());
  }

  public void goToMine() {
    LOGGER.info("{} goes to the mine.", name());
  }

  private void action(Action action) {<FILL_FUNCTION_BODY>}

  /**
   * Perform actions.
   */
  public void action(Action... actions) {
    Arrays.stream(actions).forEach(this::action);
  }

  public abstract void work();

  public abstract String name();

  enum Action {
    GO_TO_SLEEP, WAKE_UP, GO_HOME, GO_TO_MINE, WORK
  }
}

    switch (action) {
      case GO_TO_SLEEP -> goToSleep();
      case WAKE_UP -> wakeUp();
      case GO_HOME -> goHome();
      case GO_TO_MINE -> goToMine();
      case WORK -> work();
      default -> LOGGER.info("Undefined action");
    }
  
<no_super_class>