### Question:
MosaicBuilder { public TileManager createTileManager() throws IOException { return createFromInput(null); } MosaicBuilder();  MosaicBuilder(final TileManagerFactory factory); Level getLogLevel(); void setLogLevel(Level level); TileLayout getTileLayout(); void setTileLayout(final TileLayout layout); File getTileDirectory(); void setTileDirectory(final File directory); ImageReaderSpi getTileReaderSpi(); void setTileReaderSpi(final ImageReaderSpi provider); void setTileReaderSpi(String format); Envelope getMosaicEnvelope(); void setMosaicEnvelope(final Envelope envelope); Rectangle getUntiledImageBounds(); void setUntiledImageBounds(final Rectangle bounds); Dimension getTileSize(); void setTileSize(final Dimension size); static int suggestedTileSize(final int imageSize, final int tileSize,
                                        final int minSize,   final int maxSize); static int[][] suggestedNumTiles(final Rectangle imageBounds, final Dimension tileSize,
                                            final int preferredCount, final boolean multiples); Dimension[] getSubsamplings(); void setSubsamplings(final Dimension[] subsamplings); void setSubsamplings(final int[] subsamplings); TileManager createTileManager(); TileManager createTileManager(final Object input); TileManager createTileManager(final Object input, final int inputIndex,
                                         final TileWritingPolicy policy);  }### Answer:
@Test public void testSerialization() throws IOException, ClassNotFoundException { final TileManager tileManager = builder.createTileManager(sourceTiles); assertEquals(4733, tileManager.getTiles().size()); final String asText = tileManager.toString(); assertFalse(asText.trim().length() == 0); assertTrue("Expected tiles created as in setUp()", manager.equals(tileManager)); final ByteArrayOutputStream buffer = new ByteArrayOutputStream(); final ObjectOutputStream out = new ObjectOutputStream(buffer); out.writeObject(tileManager); out.close(); final ObjectInputStream in = new ObjectInputStream(new ByteArrayInputStream(buffer.toByteArray())); final TileManager serialized = (TileManager) in.readObject(); in.close(); assertNotSame(tileManager, serialized); assertEquals(tileManager, serialized); assertEquals(tileManager.getImageReaderSpis(), serialized.getImageReaderSpis()); }