@Theory
  public void deriveKeyset_isAsExpected(@FromDataPoints("allTests") TestVector t) throws Exception {
    PrfBasedKeyDerivationParameters derivationParameters =
        PrfBasedKeyDerivationParameters.builder()
            .setDerivedKeyParameters(t.derivedKeyParameters)
            .setPrfParameters(t.prfKey.getParameters())
            .build();

    @Nullable Integer idRequirement = t.expectedKey.getIdRequirementOrNull();
    PrfBasedKeyDerivationKey keyDerivationKey =
        PrfBasedKeyDerivationKey.create(derivationParameters, t.prfKey, idRequirement);
    KeysetHandle keyset =
        KeysetHandle.newBuilder()
            .addEntry(
                KeysetHandle.importKey(keyDerivationKey)
                    .withFixedId(idRequirement == null ? 789789 : idRequirement)
                    .makePrimary())
            .build();
    KeysetDeriver deriver = keyset.getPrimitive(KeysetDeriver.class);

    KeysetHandle derivedKeyset = deriver.deriveKeyset(Hex.decode(t.inputHex));

    assertThat(derivedKeyset.size()).isEqualTo(1);
    // The only thing which we need to test is equalsKey(), but we first test other things to make
    // test failures have nicer messages.
    assertThat(derivedKeyset.getAt(0).getKey().getParameters()).isEqualTo(t.derivedKeyParameters);
    assertThat(derivedKeyset.getAt(0).getKey().getIdRequirementOrNull()).isEqualTo(idRequirement);
    assertTrue(derivedKeyset.getAt(0).getKey().equalsKey(t.expectedKey));
  }
A test vector: if we use prfKey in with derivedKeyParameters and salt Hex.decode(inputHex) we
get expectedKey.

<p>Note that the test vector doesn't specify the derivation key itself. In particular, the
idRequirement of the derivationKey is obtained from the expected key (since it should always be
the same).
java_src/src/test/java/com/google/crypto/tink/keyderivation/internal/KeysetDeriverWrapperTest.java