MessageDigestCollector { public void setRawBytes(byte[] rawBytes) { reset(); try { if (rawBytes != null) { stream.write(rawBytes); } } catch (IOException ex) { LOGGER.error("Could not set RawBytes in MessageDigestCollector", ex); } } MessageDigestCollector(); void append(byte[] bytes); byte[] digest(ProtocolVersion version, CipherSuite suite); void reset(); byte[] getRawBytes(); void setRawBytes(byte[] rawBytes);  }
@Test public void testSetRawBytes() { digest.setRawBytes(testarray); assertArrayEquals(testarray, digest.getRawBytes()); }