private void updateRecentMessages(@NotNull Consumer<? super ArrayList<String>> modification) {
    ArrayList<String> messages = getRecentMessages();
    modification.accept(messages);
    setRecentMessages(messages);
  }
private void updateRecentMessages(@NotNull Consumer<? super ArrayList<String>> modification)