### Question:
AudioFactory { public static synchronized Audio loadAudio(Media media) { Check.notNull(media); final String extension = UtilFile.getExtension(media.getPath()); return Optional.ofNullable(FACTORIES.get(extension)) .orElseThrow(() -> new LionEngineException(media, ERROR_FORMAT)) .loadAudio(media); } private  AudioFactory(); static synchronized Audio loadAudio(Media media); static synchronized A loadAudio(Media media, Class<A> type); static synchronized void addFormat(AudioFormat format); static synchronized void clearFormats(); static final String ERROR_FORMAT; }### Answer:
@Test void testLoadAudioNull() { assertThrows(() -> AudioFactory.loadAudio(null), "Unexpected null argument !"); }
@Test void testLoadAudioNullFormat() { assertThrows(() -> AudioFactory.loadAudio(new MediaMock(), null), "Unexpected null argument !"); }
@Test void testLoadAudio() { AudioFactory.addFormat(new AudioVoidFormat(Arrays.asList("png"))); assertNotNull(AudioFactory.loadAudio(Medias.create("image.png"))); assertNotNull(AudioFactory.loadAudio(Medias.create("image.png"), Audio.class)); assertNotNull(AudioFactory.loadAudio(Medias.create("image.png"), AudioVoid.class)); }
@Test void testLoadAudioInvalidType() { assertThrows(() -> AudioFactory.loadAudio(Medias.create("image.wav"), MyAudio.class), "[image.wav] " + AudioFactory.ERROR_FORMAT); }