@Test
public void testToString() throws Exception {

  String keyValue = "01234567890123456";
  Keyset keyset =
      TestUtil.createKeyset(
          TestUtil.createKey(
              TestUtil.createHmacKeyData(keyValue.getBytes("UTF-8"), 16),
              42,
              KeyStatusType.ENABLED,
              OutputPrefixType.TINK));
  KeysetHandle handle = KeysetHandle.fromKeyset(keyset);
  assertEquals(keyset, handle.getKeyset());
  String keysetInfo = handle.toString();
  assertFalse(keysetInfo.contains(keyValue));
  assertTrue(handle.getKeyset().toString().contains(keyValue));
}