### Question:
CryptoUtil { protected static byte[] extractSalt( byte[] digest ) throws IllegalArgumentException { if( digest.length <= 20 ) { throw new IllegalArgumentException( "Hash was less than 21 characters; we found no salt!" ); } byte[] salt = new byte[digest.length - 20]; for( int i = 20; i < digest.length; i++ ) { salt[i - 20] = digest[i]; } return salt; } private  CryptoUtil(); static void main( final String[] args ); static String getSaltedPassword( byte[] password ); static boolean verifySaltedPassword( byte[] password, String entry );  }### Answer:
@Test public void testExtractHash() { byte[] digest; digest = Base64.getDecoder().decode( "yfT8SRT/WoOuNuA6KbJeF10OznZmb28=".getBytes() ); Assertions.assertEquals( "foo", new String( CryptoUtil.extractSalt( digest ) ) ); digest = Base64.getDecoder().decode( "tAVisOOQGAeVyP8UMFQY9qi83lxsb09e".getBytes() ); Assertions.assertEquals( "loO^", new String( CryptoUtil.extractSalt( digest ) ) ); digest = Base64.getDecoder().decode( "BZaDYvB8czmNW3MjR2j7/mklODV0ZXN0eQ==".getBytes() ); Assertions.assertEquals( "testy", new String( CryptoUtil.extractSalt( digest ) ) ); }