@Test
public void testGetPrimitives_EmptyKeyset_shouldThrowException() throws Exception {

  // Empty keyset.
  try {
    Registry.getPrimitives(KeysetHandle.fromKeyset(Keyset.getDefaultInstance()), Aead.class);
    fail("Invalid keyset. Expect GeneralSecurityException");
  } catch (GeneralSecurityException e) {
    assertExceptionContains(e, "empty keyset");
  }
}