### Question:
FontDownloader { public Observable<File> downloadAllFonts() { Timber.i("downloadAllFonts: " + mFontPackage.getName()); return downloadFonts(mFontPackage.getFontSet()); } FontDownloader(FontPackage fontPackage); Observable<File> downloadAllFonts(); Observable<File> downloadFontStyles(Style... styles); static Observable<File> downloadStyleFromPackages(List<FontPackage> packages, Style style);  }### Answer:
@Test public void testDownloadAllFonts_downloadsAllStyles() throws Exception { TestSubscriber<File> testSubscriber = new TestSubscriber<>(); FontDownloader fontDownloader = new FontDownloader(new MockFontPackage(MOCK_FONT_PACK_NAME)); fontDownloader.downloadAllFonts().subscribe(testSubscriber); testSubscriber.assertNoErrors(); List<File> downloadedFiles = testSubscriber.getOnNextEvents(); List<String> downloadedFileNames = new ArrayList<String>() {{ for (File f : downloadedFiles) add(f.getName()); }}; List<Style> expectedStyles = new ArrayList<>(Arrays.asList(Style.values())); List<String> expectedStyleNames = new ArrayList<String>() {{ for (Style s : expectedStyles) add(s.getLocalName()); }}; assertTrue(downloadedFileNames.containsAll(expectedStyleNames)); }
@Test public void testDownloadAllFonts_filesExist() throws Exception { TestSubscriber<File> testSubscriber = new TestSubscriber<>(); FontDownloader fontDownloader = new FontDownloader(new MockFontPackage(MOCK_FONT_PACK_NAME)); fontDownloader.downloadAllFonts().subscribe(testSubscriber); testSubscriber.assertNoErrors(); File downloadedFontPack = new File(MockFontPackage.TEST_FOLDER, MOCK_FONT_PACK_NAME + "FontPack"); assertTrue(downloadedFontPack.exists()); assertTrue(downloadedFontPack.isDirectory()); assertEquals(Style.values().length, downloadedFontPack.listFiles().length); }