List<String> adminList = new ArrayList<>(); String username = "root"; // 检查root用户在数据中是否存在 adminList.stream().anyMatch(s -> Objects.equals(s, username))