### Question:
EncryptedPIN implements Serializable, Loggeable { public void dump (PrintStream p, String indent) { String inner = indent + " "; p.print(indent + "<encrypted-pin"); p.print(" format=\"0" + getPINBlockFormat() + "\""); p.println(">"); p.println(inner + "<pin-block>" + ISOUtil.hexString(getPINBlock()) + "</pin-block>"); p.println(inner + "<account-number>" + getAccountNumber() + "</account-number>"); p.println(indent + "</encrypted-pin>"); } EncryptedPIN();  EncryptedPIN(byte[] pinBlock, byte pinBlockFormat, String accountNumber);  EncryptedPIN(byte[] pinBlock, byte pinBlockFormat, String accountNumber, boolean extract);  EncryptedPIN(String pinBlockHexString, byte pinBlockFormat, String accountNumber);  EncryptedPIN(String pinBlockHexString, byte pinBlockFormat, String accountNumber, boolean extract); void dump(PrintStream p, String indent); void setPINBlock(byte[] pinBlock); byte[] getPINBlock(); void setPINBlockFormat(byte pinBlockFormat); byte getPINBlockFormat(); void setAccountNumber(String extractedAccountNumber); String getAccountNumber(); static String extractAccountNumberPart(String accountNumber);  }### Answer:
@Test public void testDump() throws Throwable { byte[] pinBlock = new byte[0]; PrintStream p = new PrintStream(new ByteArrayOutputStream(), true, "UTF-16BE"); new EncryptedPIN(pinBlock, (byte) 0, "testEncryptedPINAccountNumber").dump(p, "testEncryptedPINIndent"); assertTrue(true, "Test completed without Exception"); }
@Test public void testDumpThrowsNullPointerException() throws Throwable { try { new EncryptedPIN().dump(null, "testEncryptedPINIndent"); fail("Expected NullPointerException to be thrown"); } catch (NullPointerException ex) { if (isJavaVersionAtMost(JAVA_14)) { assertNull(ex.getMessage(), "ex.getMessage()"); } else { assertEquals("Cannot invoke \"java.io.PrintStream.print(String)\" because \"p\" is null", ex.getMessage(), "ex.getMessage()"); } } }