### Question:
ThumbnailGeneratorFactory { public static ThumbnailGenerator getThumbnailGenerator(final ContentType contentType, final String colorMapPath) throws Exception { switch(contentType) { case IMAGE: return new ThumbnailImageGenerator(colorMapPath); case PDF: return new ThumbnailTextGenerator(colorMapPath); default : throw new Exception("No thumbnail supported for " + contentType + " content type."); } }  static ThumbnailGenerator getThumbnailGenerator(final ContentType contentType, final String colorMapPath);  }### Answer:
@Test public void testGetImageThumbnailGenerator() throws Exception { ThumbnailGenerator thumbnailImageGenerator = ThumbnailGeneratorFactory.getThumbnailGenerator(ContentType.IMAGE, ""); assertTrue(thumbnailImageGenerator instanceof ThumbnailImageGenerator); }
@Test public void testGetPDFThumbnailGenerator() throws Exception { ThumbnailGenerator thumbnailPDFGenerator = ThumbnailGeneratorFactory.getThumbnailGenerator(ContentType.PDF, ""); assertTrue(thumbnailPDFGenerator instanceof ThumbnailTextGenerator); }