Salsa20 implements ProtectedStringCrypto { public static Salsa20 createInstance(byte[] protectedStreamKey) { if (protectedStreamKey == null) { throw new IllegalArgumentException("ProtectedStreamKey must not be null"); } Salsa20 salsa20 = new Salsa20(); salsa20.initialize(protectedStreamKey); return salsa20; }  static Salsa20 createInstance(byte[] protectedStreamKey); @Override String decrypt(String protectedString); @Override String encrypt(String plainString);  }
@Test(expected = IllegalArgumentException.class) public void whenStreamKeyIsNullShouldThrowArgumentException() { Salsa20.createInstance(null); }