### Question:
SftpUploader { public static Uploader createUploader(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 JschUploader(JschSftpProcessor.getProcessor(product)); } private  SftpUploader(); static Uploader createUploader(final FtpProduct product); @Deprecated static KeyCryptoBuilder getKeyCryptoBuilder(); @Deprecated static UserPassBuilder getUserPassBuilder();  }### Answer:
@Test(expected = IllegalArgumentException.class) public void testCreateUploaderBadProduct() { SftpUploader.createUploader(mock(FtpProduct.class)); }
@Test(expected = NullPointerException.class) public void testCreateUploaderNullProduct() { SftpUploader.createUploader(null); }