### Question:
PSWriter { @Nullable public String getXMLStringNotNull (@Nonnull final IPSElement aPSElement) { final String ret = getXMLString (aPSElement); if (ret == null) throw new IllegalStateException ("Failed to serialize the passed PS element: " + aPSElement); return ret; } PSWriter();  PSWriter(@Nonnull final IPSWriterSettings aWriterSettings); @Nonnull IPSWriterSettings getWriterSettings(); @Nonnull ESuccess writeToFile(@Nonnull final IPSElement aPSElement, @Nonnull final File aFile); @Nonnull ESuccess writeToStream(@Nonnull final IPSElement aPSElement, @Nonnull @WillClose final OutputStream aOS); @Nonnull ESuccess writeToWriter(@Nonnull final IPSElement aPSElement, @Nonnull @WillClose final Writer aWriter); @Nullable String getXMLString(@Nonnull final IPSElement aPSElement); @Nullable String getXMLStringNotNull(@Nonnull final IPSElement aPSElement); @Override String toString();  }### Answer:
@Test public void testReadAll () throws Exception { final PSWriter aWriter = new PSWriter (); for (final IReadableResource aRes : SchematronTestHelper.getAllValidSchematronFiles ()) { final PSSchema aSchema1 = new PSReader (aRes).readSchema (); assertNotNull (aSchema1); final CollectingPSErrorHandler aLogger = new CollectingPSErrorHandler (); assertTrue (aRes.getPath (), aSchema1.isValid (aLogger)); assertTrue (aLogger.isEmpty ()); final String sXML1 = aWriter.getXMLStringNotNull (aSchema1); final PSSchema aSchema2 = new PSReader (new ReadableResourceString (sXML1, StandardCharsets.UTF_8)).readSchema (); final String sXML2 = aWriter.getXMLStringNotNull (aSchema2); assertEquals (sXML1, sXML2); } }