### Question:
Helper { public static <T> void serialize(T object, File file) { try ( FileOutputStream fileOut = new FileOutputStream(file); ObjectOutputStream out = new ObjectOutputStream(fileOut); ) { out.writeObject(object); out.flush(); } catch (Exception e) { throw new DigiDoc4JException(e); } } private  Helper(); static File[] getFilesFromPath(Path path); static File[] getFilesFromPath(Path path, FileFilter filter); static File[] getFilesFromResourcePath(Path path); static File[] getFilesFromResourcePath(Path path, FileFilter filter); static byte[] generateRandomBytes(int length); static boolean isZipFile(InputStream stream); static boolean isZipFile(File file); static boolean isXMLFile(File file); static void deleteFile(String file); static String extractSignature(String file, int index); static void serialize(T object, File file); static void serialize(T object, String filename); static T deserializer(File file); static T deserializer(String filename); static OutputStream bufferedOutputStream(File file); static X509Certificate loadCertificate(String filePath); static boolean hasSpecialCharacters(String fileName); static String getIdentifier(String identifier); static SignaturePolicyProvider getBdocSignaturePolicyProvider(DSSDocument signature); static List<byte[]> getAllFilesFromContainerAsBytes(Container container); static List<byte[]> getAllFilesFromContainerPathAsBytes(String pathFrom); static void saveAllFilesFromContainerToFolder(Container container, String path); static void saveAllFilesFromContainerPathToFolder(String pathFrom, String pathTo); static void deleteTmpFiles(); static boolean isPdfFile(String file); static String bytesToHex(byte[] bytes, int maxLen); static void printWarningSection(Logger logger, String warningMessage); static void printErrorSection(Logger logger, String errorMessage); static final String SPECIAL_CHARACTERS; }### Answer:
@Test(expected = DigiDoc4JException.class) public void serializeThrowsException() { Helper.serialize(ContainerBuilder.aContainer().build(), (File) null); }