@Test
  public void create_prfKeyHasNoStreamingPrf_throws() throws Exception {
    PrfParameters prfParameters =
        new PrfParameters() {
          @Override
          public boolean hasIdRequirement() {
            return false;
          }
        };
    // We create an ad-hoc subclass of "PrfKey". For this one, it is not possible that a map
    // (Anonymous subclass) -> StreamingPrf was registered, since the subclass cannot be referenced
    // from anywhere.
    PrfKey prfKey =
        new PrfKey() {
          @Override
          public PrfParameters getParameters() {
            return prfParameters;
          }

          @Override
          public boolean equalsKey(Key key) {
            return key == this;
          }

          @Override
          public Integer getIdRequirementOrNull() {
            return null;
          }
        };
    AesGcmParameters derivedKeyParameters =
        AesGcmParameters.builder()
            .setKeySizeBytes(16)
            .setIvSizeBytes(12)
            .setTagSizeBytes(16)
            .setVariant(AesGcmParameters.Variant.NO_PREFIX)
            .build();
    PrfBasedKeyDerivationParameters derivationParameters =
        PrfBasedKeyDerivationParameters.builder()
            .setDerivedKeyParameters(derivedKeyParameters)
            .setPrfParameters(prfParameters)
            .build();
    PrfBasedKeyDerivationKey keyDerivationKey =
        PrfBasedKeyDerivationKey.create(derivationParameters, prfKey, /* idRequirement= */ null);

    assertThrows(GeneralSecurityException.class, () -> PrfBasedKeyDeriver.create(keyDerivationKey));
  }
Another test class for PrfBasedDeriver. We use a different class because we want to use the
Keyset API and do not want to touch the protos. This means that the includes here are the normal
classes and not the protos -- which means that all the includes would clash and we would have to
extend either the proto or the java AesGcmKey -- for example, if we put it in the same file.

<p>Hence we make a different file.

<p>The tests here should cover everything, but the previous test also checks some behavior of the
internal API (which will be removed). Once the internal API is removed we can remove the other
tests as well.
java_src/src/test/java/com/google/crypto/tink/keyderivation/internal/PrfBasedKeyDeriverTest.java