@Override
                public void test(Provider p, String algorithm) throws Exception {
                    final KeyPairGenerator kpg = KeyPairGenerator.getInstance("DSA", p);
                    kpg.initialize(dsaSpec);
                    KeyPair pair = kpg.generateKeyPair();
                    DSAPrivateKey privKey = (DSAPrivateKey) pair.getPrivate();
                    DSAPublicKey pubKey = (DSAPublicKey) pair.getPublic();

                    DSAParams actualParams = privKey.getParams();
                    assertNotNull("DSA params should not be null", actualParams);

                    assertEquals("DSA P should be the same as supplied",
                        DSA_P, actualParams.getP());
                    assertEquals("DSA Q should be the same as supplied",
                        DSA_Q, actualParams.getQ());
                    assertEquals("DSA G should be the same as supplied",
                        DSA_G, actualParams.getG());

                    actualParams = pubKey.getParams();
                    assertNotNull("DSA params should not be null", actualParams);

                    assertEquals("DSA P should be the same as supplied",
                        DSA_P, actualParams.getP());
                    assertEquals("DSA Q should be the same as supplied",
                        DSA_Q, actualParams.getQ());
                    assertEquals("DSA G should be the same as supplied",
                        DSA_G, actualParams.getG());

                }
DH parameters pre-generated so that the test doesn't take too long.
These parameters were generated with:
<p>
openssl gendh 512 | openssl dhparams -C
common/src/test/java/org/conscrypt/java/security/KeyPairGeneratorTest.java