### Question:
SpatialMetadataFormat extends IIOMetadataFormatImpl { private static String toString(final Comparable<?> value) { return (value != null) ? value.toString() : null; } protected  SpatialMetadataFormat(final String rootName); static SpatialMetadataFormat getStreamInstance(final String name); static SpatialMetadataFormat getImageInstance(final String name); @Override boolean canNodeAppear(final String elementName, final ImageTypeSpecifier imageType); String getElementParent(final String elementName); String getElementPath(final String elementName); MetadataStandard getElementStandard(final String elementName); @Override String getElementDescription(final String elementName, final Locale locale); @Override String getAttributeDescription(final String elementName, final String attrName, final Locale locale); T getDefaultValue(final Class<T> type); TreeTableNode toTreeTable(final Locale locale); @Override String toString(); static final String GEOTK_FORMAT_NAME; static final String ISO_FORMAT_NAME; }### Answer:
@Test public void testToString() throws IOException { final String stream = SpatialMetadataFormat.getStreamInstance(GEOTK_FORMAT_NAME).toString(); final String image = SpatialMetadataFormat.getImageInstance (GEOTK_FORMAT_NAME).toString(); assertTrue(!stream.isEmpty()); assertTrue(!image .isEmpty()); if (false) { try (Writer out = new OutputStreamWriter(new FileOutputStream("SpatialMetadataFormat.txt"), "UTF-8")) { out.write(stream); out.write(System.lineSeparator()); out.write(image); } } }