private void assertGetEncoded(PSSParameterSpec spec, byte[] expectedEncoded) throws Exception {
        AlgorithmParameters params = AlgorithmParameters.getInstance("PSS");
        params.init(spec);
        byte[] encoded = params.getEncoded("ASN.1");
        assertTrue(Arrays.equals(expectedEncoded, encoded));
        // Assert that getEncoded() returns ASN.1 form.
        assertTrue(Arrays.equals(encoded, params.getEncoded()));
    }
Payload of SEQUENCE extends beyond the SEQUENCE.
common/src/test/java/org/conscrypt/java/security/AlgorithmParametersPSSTest.java