### Question:
Sha256 { public ByteArray hashIt(String text) { byte[] sha256 = sha256Digest.digest(text.getBytes()); return new ByteArray(sha256); } Sha256(); ByteArray hashIt(String text);  }### Answer:
@Test public void shouldHash() throws Exception { ByteArray expected = new ByteArray(new int[]{19, 211, 30, 150, 26, 26, 216, 236, 47, 22, 177, 12, 76, 152, 46, 8, 118, 168, 120, 173, 109, 241, 68, 86, 110, 225, 137, 74, 203, 112, 249, 195}); ByteArray sha256Bytes = sha256.hashIt("dBjftJeZ4CVP-mB92K27uhbUJU1p1r_wW1gFWFOEjXk"); assertThat(sha256Bytes, is(equalTo(expected))); }