### Question:
EnvVarHelper { @Nullable public static String getUnifiedSysEnvName (@Nonnull @Nonempty final String sName, final char cReplacement) { ValueEnforcer.notEmpty (sName, "Name"); final StringBuilder ret = new StringBuilder (sName.length ()); int nIndex = 0; for (final char c : sName.toCharArray ()) { final char cUpper = Character.toUpperCase (c); final boolean bIsValid = nIndex == 0 ? isValidFirstChar (cUpper) : isValidFollowingChar (cUpper); ret.append (bIsValid ? cUpper : cReplacement); nIndex++; } return ret.toString (); } private  EnvVarHelper(); static boolean isValidFirstChar(final char c); static boolean isValidFollowingChar(final char c); @Nullable static String getUnifiedSysEnvName(@Nonnull @Nonempty final String sName, final char cReplacement); static final char DEFAULT_REPLACEMENT_CHAR; }### Answer:
@Test public void testUnification () { assertEquals ("LANG", EnvVarHelper.getUnifiedSysEnvName ("LANG", '_')); assertEquals ("LANG", EnvVarHelper.getUnifiedSysEnvName ("lanG", '_')); assertEquals ("LA_NG", EnvVarHelper.getUnifiedSysEnvName ("LA_NG", '_')); assertEquals ("LA_NG", EnvVarHelper.getUnifiedSysEnvName ("LA?NG", '_')); assertEquals ("_ABC", EnvVarHelper.getUnifiedSysEnvName ("0ABC", '_')); assertEquals ("_123", EnvVarHelper.getUnifiedSysEnvName ("0123", '_')); assertEquals ("____", EnvVarHelper.getUnifiedSysEnvName ("0?*#", '_')); assertEquals ("I_REALLY_DON_T_KNOW_THAT_ENV_VAR_", EnvVarHelper.getUnifiedSysEnvName ("I really don't know that env var!", '_')); }