UserUtil { public static List<Map<String, String>> copyAndConvertExternalIdsToLower( List<Map<String, String>> externalIds) { List<Map<String, String>> list = new ArrayList<>(); if (CollectionUtils.isNotEmpty(externalIds)) { storeOriginalExternalIdsValue(externalIds); list = convertExternalIdsValueToLowerCase(externalIds); } return list; } private  UserUtil(); @SuppressWarnings("unchecked") static void checkPhoneUniqueness(User user, String opType); @SuppressWarnings("unchecked") static void checkPhoneUniqueness(String phone); static boolean identifierExists(String type, String value); static void checkEmailUniqueness(String email); static Map<String, Object> validateExternalIdsAndReturnActiveUser(
      Map<String, Object> userMap); @SuppressWarnings("unchecked") static Map<String, Object> getUserFromExternalId(Map<String, Object> userMap); static String getUserIdFromExternalId(Map<String, Object> userMap); @SuppressWarnings("unchecked") static void checkEmailUniqueness(User user, String opType); static void validateUserPhoneEmailAndWebPages(User user, String operationType); static String getEncryptedData(String value); static List<Map<String, String>> copyAndConvertExternalIdsToLower(
      List<Map<String, String>> externalIds); static void storeOriginalExternalIdsValue(List<Map<String, String>> externalIds); static List<Map<String, String>> convertExternalIdsValueToLowerCase(
      List<Map<String, String>> externalIds); @SuppressWarnings("unchecked") static void checkExternalIdUniqueness(User user, String operation); static String encryptData(String value); static boolean updatePassword(Map<String, Object> userMap); static void addMaskEmailAndPhone(Map<String, Object> userMap); static void addMaskEmailAndMaskPhone(Map<String, Object> userMap); @SuppressWarnings("unchecked") static Map<String, Object> encryptUserData(Map<String, Object> userMap); static Map<String, Object> checkProfileCompleteness(Map<String, Object> userMap); static void setUserDefaultValueForV3(Map<String, Object> userMap); static String generateUniqueString(int length); static void setUserDefaultValue(Map<String, Object> userMap, String callerId); static void validateExternalIds(User user, String operationType); static void checkEmailSameOrDiff(
      Map<String, Object> userRequestMap, Map<String, Object> userDbRecord); static void validateUserExternalIds(User user); static List<Map<String, Object>> getActiveUserOrgDetails(String userId); static List<Map<String, Object>> getAllUserOrgDetails(String userId); static void toLower(Map<String, Object> userMap);  }
@Test public void copyAndConvertExternalIdsToLower() { List<Map<String, String>> externalIds = new ArrayList<Map<String, String>>(); Map<String, String> userExternalIdMap = new HashMap<String, String>(); userExternalIdMap.put(JsonKey.ID, "test123"); userExternalIdMap.put(JsonKey.PROVIDER, "State"); userExternalIdMap.put(JsonKey.ID_TYPE, "UserExtId"); externalIds.add(userExternalIdMap); externalIds = UserUtil.copyAndConvertExternalIdsToLower(externalIds); userExternalIdMap = externalIds.get(0); assertNotNull(userExternalIdMap.get(JsonKey.ORIGINAL_EXTERNAL_ID)); assertEquals(userExternalIdMap.get(JsonKey.PROVIDER), "state"); }