### Question:
HashHelper { public static String sha256Hex(Serializable object) { if (object instanceof String) { return DigestUtils.sha256Hex(((String) object).getBytes(StandardCharsets.UTF_8)); } else { return DigestUtils.sha256Hex(SerializationUtils.serialize(object)); } } private  HashHelper(); static String sha256Hex(Serializable object);  }### Answer:
@Test public void testSha256Hex() { Serializable testObject1 = new TestClass(); Serializable testObject2 = new TestClass(); String result1 = HashHelper.sha256Hex(testObject1); String result2 = HashHelper.sha256Hex(testObject2); assertEquals(result2, result1); }
@Test public void testSha256HexString() { String testString = "abcäöü"; String expectedResult = DigestUtils.sha256Hex(testString.getBytes(StandardCharsets.UTF_8)); String result = HashHelper.sha256Hex(testString); assertEquals(expectedResult, result); }