### Question:
SftpDownloader { public static Downloader createDownloader(final FtpProduct product) { if (product == null) throw new NullPointerException("Product cannot be null."); if (!(product instanceof UserPassProduct) && !(product instanceof KeyCryptoProduct)) throw new IllegalArgumentException("Invalid product type: " + product.getClass()); return new JschDownloader(JschSftpProcessor.getProcessor(product)); } private  SftpDownloader(); static Downloader createDownloader(final FtpProduct product); @Deprecated static KeyCryptoBuilder getKeyCryptoBuilder(); @Deprecated static UserPassBuilder getUserPassBuilder();  }### Answer:
@Test(expected = IllegalArgumentException.class) public void testCreateDownloaderBadProduct() { SftpDownloader.createDownloader(mock(FtpProduct.class)); }
@Test(expected = NullPointerException.class) public void testCreateDownloaderNull() { SftpDownloader.createDownloader(null); }