Program: 172824
Project: 172824
Buggy source:
@Override public CommandResult execute(CommandSource source,CommandContext context) throws CommandException {
  Optional<ChatEnum> optionalChatType=context.<ChatEnum>getOne("String_Node_Str");
  if (source instanceof Player) {
    Player player=(Player)source;
    if (FactionLogic.getFactionName(player.getUniqueId()) != null) {
      if (optionalChatType.isPresent()) {
        if (EagleFactions.ChatList.containsKey(player.getUniqueId())) {
          if (optionalChatType.get().equals(ChatEnum.Global)) {
            EagleFactions.ChatList.remove(player.getUniqueId());
            player.sendMessage(Text.of(PluginInfo.PluginPrefix,PluginMessages.CHANGED_CHAT_TO + "String_Node_Str",TextColors.GOLD,PluginMessages.GLOBAL_CHAT,TextColors.RESET,"String_Node_Str"));
          }
 else {
            EagleFactions.ChatList.replace(player.getUniqueId(),EagleFactions.ChatList.get(player.getUniqueId()),optionalChatType.get());
            player.sendMessage(Text.of(PluginInfo.PluginPrefix,PluginMessages.CHANGED_CHAT_TO + "String_Node_Str",TextColors.GOLD,optionalChatType.get(),TextColors.RESET,"String_Node_Str"));
          }
        }
 else {
          EagleFactions.ChatList.put(player.getUniqueId(),optionalChatType.get());
          player.sendMessage(Text.of(PluginInfo.PluginPrefix,PluginMessages.CHANGED_CHAT_TO + "String_Node_Str",TextColors.GOLD,optionalChatType.get(),TextColors.RESET,"String_Node_Str"));
        }
      }
 else {
        if (EagleFactions.ChatList.containsKey(player.getUniqueId())) {
          if (EagleFactions.ChatList.get(player.getUniqueId()).equals(ChatEnum.Alliance)) {
            EagleFactions.ChatList.replace(player.getUniqueId(),ChatEnum.Alliance,ChatEnum.Faction);
            player.sendMessage(Text.of(PluginInfo.PluginPrefix,PluginMessages.CHANGED_CHAT_TO + "String_Node_Str",TextColors.GOLD,PluginMessages.FACTION_CHAT,TextColors.RESET,"String_Node_Str"));
          }
 else {
            EagleFactions.ChatList.remove(player.getUniqueId());
            player.sendMessage(Text.of(PluginInfo.PluginPrefix,PluginMessages.CHANGED_CHAT_TO + "String_Node_Str",TextColors.GOLD,PluginMessages.GLOBAL_CHAT,TextColors.RESET,"String_Node_Str"));
          }
        }
 else {
          EagleFactions.ChatList.put(player.getUniqueId(),ChatEnum.Alliance);
          player.sendMessage(Text.of(PluginInfo.PluginPrefix,PluginMessages.CHANGED_CHAT_TO + "String_Node_Str",TextColors.GOLD,PluginMessages.ALLIANCE_CHAT,TextColors.RESET,"String_Node_Str"));
        }
      }
    }
 else {
      source.sendMessage(Text.of(PluginInfo.ErrorPrefix,TextColors.RED,PluginMessages.YOU_MUST_BE_IN_FACTION_IN_ORDER_TO_USE_THIS_COMMAND));
    }
  }
 else {
    source.sendMessage(Text.of(PluginInfo.ErrorPrefix,TextColors.RED,PluginMessages.ONLY_IN_GAME_PLAYERS_CAN_USE_THIS_COMMAND));
  }
  return CommandResult.success();
}

Fixed version (ground truth):
@Override public CommandResult execute(CommandSource source,CommandContext context) throws CommandException {
  Optional<ChatEnum> optionalChatType=context.<ChatEnum>getOne("String_Node_Str");
  if (source instanceof Player) {
    Player player=(Player)source;
    if (!FactionLogic.getFactionName(player.getUniqueId()).equals("String_Node_Str")) {
      if (optionalChatType.isPresent()) {
        if (EagleFactions.ChatList.containsKey(player.getUniqueId())) {
          if (optionalChatType.get().equals(ChatEnum.Global)) {
            EagleFactions.ChatList.remove(player.getUniqueId());
            player.sendMessage(Text.of(PluginInfo.PluginPrefix,PluginMessages.CHANGED_CHAT_TO + "String_Node_Str",TextColors.GOLD,PluginMessages.GLOBAL_CHAT,TextColors.RESET,"String_Node_Str"));
          }
 else {
            EagleFactions.ChatList.replace(player.getUniqueId(),EagleFactions.ChatList.get(player.getUniqueId()),optionalChatType.get());
            player.sendMessage(Text.of(PluginInfo.PluginPrefix,PluginMessages.CHANGED_CHAT_TO + "String_Node_Str",TextColors.GOLD,optionalChatType.get(),TextColors.RESET,"String_Node_Str"));
          }
        }
 else {
          EagleFactions.ChatList.put(player.getUniqueId(),optionalChatType.get());
          player.sendMessage(Text.of(PluginInfo.PluginPrefix,PluginMessages.CHANGED_CHAT_TO + "String_Node_Str",TextColors.GOLD,optionalChatType.get(),TextColors.RESET,"String_Node_Str"));
        }
      }
 else {
        if (EagleFactions.ChatList.containsKey(player.getUniqueId())) {
          if (EagleFactions.ChatList.get(player.getUniqueId()).equals(ChatEnum.Alliance)) {
            EagleFactions.ChatList.replace(player.getUniqueId(),ChatEnum.Alliance,ChatEnum.Faction);
            player.sendMessage(Text.of(PluginInfo.PluginPrefix,PluginMessages.CHANGED_CHAT_TO + "String_Node_Str",TextColors.GOLD,PluginMessages.FACTION_CHAT,TextColors.RESET,"String_Node_Str"));
          }
 else {
            EagleFactions.ChatList.remove(player.getUniqueId());
            player.sendMessage(Text.of(PluginInfo.PluginPrefix,PluginMessages.CHANGED_CHAT_TO + "String_Node_Str",TextColors.GOLD,PluginMessages.GLOBAL_CHAT,TextColors.RESET,"String_Node_Str"));
          }
        }
 else {
          EagleFactions.ChatList.put(player.getUniqueId(),ChatEnum.Alliance);
          player.sendMessage(Text.of(PluginInfo.PluginPrefix,PluginMessages.CHANGED_CHAT_TO + "String_Node_Str",TextColors.GOLD,PluginMessages.ALLIANCE_CHAT,TextColors.RESET,"String_Node_Str"));
        }
      }
    }
 else {
      source.sendMessage(Text.of(PluginInfo.ErrorPrefix,TextColors.RED,PluginMessages.YOU_MUST_BE_IN_FACTION_IN_ORDER_TO_USE_THIS_COMMAND));
    }
  }
 else {
    source.sendMessage(Text.of(PluginInfo.ErrorPrefix,TextColors.RED,PluginMessages.ONLY_IN_GAME_PLAYERS_CAN_USE_THIS_COMMAND));
  }
  return CommandResult.success();
}