@Theory
  public void multipleKeysReadKeysetWithEncryptDecrypt()
      throws Exception {
    KeysetHandle handle =
        TinkJsonProtoKeysetFormat.parseKeyset(
            JSON_PRF_KEYSET_WITH_MULTIPLE_KEYS, InsecureSecretKeyAccess.get());

    PrfSet prfSet = handle.getPrimitive(PrfSet.class);

    byte[] data = "data".getBytes(UTF_8);
    byte[] outputPrimary = prfSet.computePrimary(data, 12);

    byte[] output1 = prfSet.getPrfs().get(166506972).compute(data, 12);
    assertThat(output1).isNotEqualTo(outputPrimary);
    byte[] output2 = prfSet.getPrfs().get(1781110497).compute(data, 12);
    assertThat(output2).isEqualTo(outputPrimary);
    byte[] output3 = prfSet.getPrfs().get(1593211602).compute(data, 12);
    assertThat(output3).isNotEqualTo(outputPrimary);

  }
Unit tests for the Prf package. Uses only the public API.
java_src/src/test/java/com/google/crypto/tink/prf/PrfTest.java