public void testPBEParameterSpec(){
  byte[] salt={1,2,3,4,5};
  int iterationCount=10;
  try {
    new PBEParameterSpec(null,iterationCount);
    fail("A NullPointerException should be was thrown " + "in the case of null salt.");
  }
 catch (  NullPointerException e) {
  }
  PBEParameterSpec pbeps=new PBEParameterSpec(salt,iterationCount);
  salt[0]++;
  assertFalse("The change of salt specified in the constructor " + "should not cause the change of internal array.",salt[0] == pbeps.getSalt()[0]);
}

public void testPBEParameterSpec ( ) { byte [ ] salt = { 1 , 2 , 3 , 4 , 5 } ; int iterationCount = 10 ; try { new PBEParameterSpec ( null , iterationCount ) ; fail ( "A NullPointerException should be was thrown " + "in the case of null salt." ) ; } catch ( NullPointerException e ) { } PBEParameterSpec pbeps = new PBEParameterSpec ( salt , iterationCount ) ; salt [ 0 ] ++ ; assertFalse ( "The change of salt specified in the constructor " + "should not cause the change of internal array." , salt [ 0 ] == pbeps . getSalt ( ) [ 0 ] ) ; }
pbeparameterspec ( byte [ ] salt , int iterationcount ) method testing . tests the behavior of the method in the case of null input array and tests that input array is copied during the object initialization .
