// init(AlgorithmParameterSpec)
BigInteger p = BigInteger.ONE;
BigInteger q = BigInteger.TEN;
BigInteger g = BigInteger.ZERO;
params.init(new DSAParameterSpec(p, q, g));
// getEncoded() and getEncoded(String) (TODO verify returned encoding)
byte[] enc = params.getEncoded();
assertNotNull(enc);
assertNotNull(params.getEncoded("ASN.1"));
// TODO assertNotNull(params.getEncoded(null)); // HARMONY-2680
// getParameterSpec(Class)
DSAParameterSpec spec = params.getParameterSpec(DSAParameterSpec.class);
assertEquals("p is wrong ", p, spec.getP());
assertEquals("q is wrong ", q, spec.getQ());
assertEquals("g is wrong ", g, spec.getG());
// init(byte[])
params = AlgorithmParameters.getInstance("DSA");
params.init(enc);
assertTrue("param encoded is different", Arrays.equals(enc, params