### Question:
Utils { public static String resolvePassword( VariableSpace variables, String password ) { String resolvedPassword = variables.environmentSubstitute( password ); if ( resolvedPassword != null ) { return Encr.decryptPasswordOptionallyEncrypted( resolvedPassword ); } else { return resolvedPassword; } }  static int getDamerauLevenshteinDistance( String s, String t ); static boolean isEmpty( CharSequence val ); static boolean isEmpty( CharSequence[] strings ); static boolean isEmpty( Object[] array ); static boolean isEmpty( List<?> list ); static String resolvePassword( VariableSpace variables, String password ); static String[][] normalizeArrays( int normalizeToLength, String[]... arraysToNormalize ); static long[][] normalizeArrays( int normalizeToLength, long[]... arraysToNormalize ); static int[][] normalizeArrays( int normalizeToLength, int[]... arraysToNormalize ); static boolean[][] normalizeArrays( int normalizeToLength, boolean[]... arraysToNormalize ); static short[][] normalizeArrays( int normalizeToLength, short[]... arraysToNormalize );  }### Answer:
@Test public void testResolvePassword() { String password = "password"; assertSame( password, Utils.resolvePassword( Variables.getADefaultVariableSpace(), password ).intern() ); }
@Test public void testResolvePasswordEncrypted() { String decPassword = "password"; String encPassword = "Encrypted 2be98afc86aa7f2e4bb18bd63c99dbdde"; assertSame( decPassword, Utils.resolvePassword( Variables.getADefaultVariableSpace(), encPassword ).intern() ); }
@Test public void testResolvePasswordNull() { String password = null; assertSame( password, Utils.resolvePassword( Variables.getADefaultVariableSpace(), password ) ); }
@Test public void testResolvePasswordVariable() { String passwordKey = "PASS_VAR"; String passwordVar = "${" + passwordKey + "}"; String passwordValue = "password"; Variables vars = new Variables(); vars.setVariable( passwordKey, passwordValue ); assertSame( passwordValue, Utils.resolvePassword( vars, passwordVar ).intern() ); }