public final void testIsStatePreserved1(){
  byte[] encodedKey=new byte[]{(byte)1,(byte)2,(byte)3,(byte)4};
  EncodedKeySpec meks=new MyEncodedKeySpec(encodedKey);
  encodedKey[3]=(byte)5;
  byte[] ek=meks.getEncoded();
  assertTrue(ek[3] == (byte)4);
}

public final void testIsStatePreserved1 ( ) { byte [ ] encodedKey = new byte [ ] { ( byte ) 1 , ( byte ) 2 , ( byte ) 3 , ( byte ) 4 } ; EncodedKeySpec meks = new MyEncodedKeySpec ( encodedKey ) ; encodedKey [ 3 ] = ( byte ) 5 ; byte [ ] ek = meks . getEncoded ( ) ; assertTrue ( ek [ 3 ] == ( byte ) 4 ) ; }
tests that internal state of the object can not be modified by modifying initial array value
