@Test public void testWrapNoPrimaryThrows() throws Exception { byte[] primaryKeyValue = Random.randBytes(KEY_SIZE); Keyset.Key primary = TestUtil.createKey( TestUtil.createPrfKeyData(primaryKeyValue), 5, KeyStatusType.ENABLED, OutputPrefixType.RAW); final Prf unusedPrf = new Prf() { @Override public byte[] compute(byte[] input, int outputLength) throws GeneralSecurityException { return new byte[0]; } }; final PrimitiveSet<PrfSet> primitiveSet = PrimitiveSet.newPrimitiveSet(PrfSet.class); primitiveSet.addPrimitive( new PrfSet() { @Override public int getPrimaryId() { return 0; } @Override public Map<Integer, Prf> getPrfs() throws GeneralSecurityException { HashMap<Integer, Prf> prfMap = new HashMap<>(); prfMap.put(0, unusedPrf); return prfMap; } }, primary); assertThrows( GeneralSecurityException.class, new ThrowingRunnable() { @Override public void run() throws Throwable { new PrfSetWrapper().wrap(primitiveSet); } }); }
@Override public PrfSet wrap(PrimitiveSet<PrfSet> set) throws GeneralSecurityException { return new WrappedPrfSet(set); }
PrfSetWrapper implements PrimitiveWrapper<PrfSet, PrfSet> { @Override public PrfSet wrap(PrimitiveSet<PrfSet> set) throws GeneralSecurityException { return new WrappedPrfSet(set); } }
PrfSetWrapper implements PrimitiveWrapper<PrfSet, PrfSet> { @Override public PrfSet wrap(PrimitiveSet<PrfSet> set) throws GeneralSecurityException { return new WrappedPrfSet(set); }  }
PrfSetWrapper implements PrimitiveWrapper<PrfSet, PrfSet> { @Override public PrfSet wrap(PrimitiveSet<PrfSet> set) throws GeneralSecurityException { return new WrappedPrfSet(set); }  @Override PrfSet wrap(PrimitiveSet<PrfSet> set); @Override Class<PrfSet> getPrimitiveClass(); @Override Class<PrfSet> getInputPrimitiveClass(); static void register(); }
PrfSetWrapper implements PrimitiveWrapper<PrfSet, PrfSet> { @Override public PrfSet wrap(PrimitiveSet<PrfSet> set) throws GeneralSecurityException { return new WrappedPrfSet(set); }  @Override PrfSet wrap(PrimitiveSet<PrfSet> set); @Override Class<PrfSet> getPrimitiveClass(); @Override Class<PrfSet> getInputPrimitiveClass(); static void register();  }