CachedObjectPreparator extends Preparator<CachedObject> { @Override public void prepare() { object.setCachedInformationType(object.getCachedInformationTypeConfig()); if (object.getHashValueLengthConfig() != null) { object.setHashValueLength(object.getHashValueLengthConfig()); } if (object.getHashValueConfig() != null) { object.setHashValue(object.getHashValueConfig()); } else { object.setHashValue((ModifiableByteArray) null); } } CachedObjectPreparator(Chooser chooser, CachedObject object); @Override void prepare();  }
@Test public void testPreparator() { TlsContext context = new TlsContext(); CachedObject object = new CachedObject(cachedInfoType, hashLength, hash); CachedObjectPreparator preparator = new CachedObjectPreparator(context.getChooser(), object); preparator.prepare(); assertEquals(cachedInfoType, (long) object.getCachedInformationType().getValue()); assertEquals(hashLength, (long) object.getHashValueLength().getValue()); assertArrayEquals(hash, object.getHashValue().getValue()); }