### Question:
MGF1BytesGeneratorExt implements DerivationFunction { public Digest getDigest() { return this.digest; } MGF1BytesGeneratorExt(Digest digest, int counterStart); void init(DerivationParameters param); Digest getDigest(); int generateBytes(byte[] out, int outOff, int len);  }### Answer:
@Test public void getDigest() { MGF1BytesGeneratorExt ext = new MGF1BytesGeneratorExt(new SHA1Digest(), 1); byte[] VZ = BigIntegers.asUnsignedByteArray(1, BigInteger.ONE); DerivationParameters kdfParam = new MGFParameters(VZ); ext.init(kdfParam); byte[] K1 = new byte[4]; assert ext.generateBytes(K1, 0, K1.length) > 0; Assert.assertNotNull(ext.getDigest()); }