### Question:
SecureKeySpec implements Serializable, Loggeable { @Override public void dump(PrintStream p, String indent) { String inner = indent + " "; p.print(indent + "<secure-key-spec"); if (scheme != null) p.print(" scheme=\"" + scheme + "\""); if (keyName != null) p.print(" name=\"" + keyName + "\""); p.println(">"); if (getKeyLength() > 0) p.println(inner + "<length>" + getKeyLength() + "</length>"); if (getKeyType() != null) { p.println(inner + "<type>" + getKeyType() + "</type>"); p.println(inner + "<variant>" + getVariant() + "</variant>"); } String keyblok = formKeyHeader(inner); if (keyblok != null) { p.println(inner + "<header>"); p.print(keyblok); p.println(inner + "</header>"); } if (!optionalHeaders.isEmpty()) { p.println(inner + "<optional-header>"); String inner2 = inner + " "; for (Entry<String, String> ent : optionalHeaders.entrySet()) p.println(inner2 + "<entry id=\""+ ent.getKey() + "\" value=\""+ ent.getValue()+ "\"/>"); p.println(inner + "</optional-header>"); } if (getKeyBytes() != null) p.println(inner + "<data>" + ISOUtil.hexString(getKeyBytes()) + "</data>"); if (getKeyBlockMAC() != null) p.println(inner + "<mac>" + ISOUtil.hexString(getKeyBlockMAC()) + "</mac>"); if (getKeyCheckValue() != null) p.println(inner + "<check-value>" + ISOUtil.hexString(getKeyCheckValue()) + "</check-value>"); p.println(indent + "</secure-key-spec>"); } SecureKeySpec(); void setScheme(KeyScheme scheme); KeyScheme getScheme(); void setKeyLength(int keyLength); int getKeyLength(); void setKeyType(String keyType); String getKeyType(); void setVariant(int variant); int getVariant(); char getKeyBlockVersion(); void setKeyBlockVersion(char keyBlockVersion); KeyUsage getKeyUsage(); void setKeyUsage(KeyUsage keyUsage); Algorithm getAlgorithm(); void setAlgorithm(Algorithm algorithm); ModeOfUse getModeOfUse(); void setModeOfUse(ModeOfUse modeOfUse); String getKeyVersion(); void setKeyVersion(String keyVersion); Exportability getExportability(); void setExportability(Exportability exportability); String getReserved(); void setReserved(String reserved); Map<String, String> getOptionalHeaders(); byte[] getKeyBlockMAC(); void setKeyBlockMAC(byte[] keyBlockMAC); void setKeyBytes(byte[] keyBytes); byte[] getKeyBytes(); void setKeyCheckValue(byte[] keyCheckValue); byte[] getKeyCheckValue(); String getKeyName(); void setKeyName(String keyName); @Override void dump(PrintStream p, String indent);  }### Answer:
@Test public void testDumpEmpty() { String indent = "____"; instance.dump(ps, indent); StringBuilder sb = new StringBuilder(128); sb.append(indent).append("<secure-key-spec>").append(NL); sb.append(indent).append("</secure-key-spec>").append(NL); assertEquals(sb.toString(), os.toString()); }