### Question:
YumRepository extends RPMRepository<RPMRepoPackage> { @Override public final Set<RPMRepoPackage> listRemotePackages() throws RepositoryException { String list = null; try { checkTmpDirSetup(); yumExpireCache(); list = yumListAll(); } catch (IOException e) { String message = "IO Exception getting yum info"; LOGGER.error(message, e); throw new RepositoryException(message, e); } int headerPos = list.indexOf(YUM_PACKAGE_HEADER); int errorPos = list.indexOf(YUM_ERROR_STRING); if (headerPos == -1 || errorPos != -1) { throw new RepositoryException(String.format( "Failed to retrieve the list of packages at mirrorList:%s & baseUrl:%s", mirrorListUrl, getBaseUrl())); } list = list.substring(list.indexOf(YUM_PACKAGE_HEADER) + YUM_PACKAGE_HEADER.length()); list = list.trim(); Set<RPMRepoPackage> packages = new HashSet<>(); Matcher matcher = YUM_LIST_PACKAGE_LINE.matcher(list); while (matcher.find()) { packages.add(new RPMRepoPackage( matcher.group("name"), matcher.group("version"), matcher.group("release"), matcher.group("architecture"), this )); } return packages; } YumRepository(final String name,
                         final URL mirrorListUrl,
                         final URL baseUrl,
                         final boolean gpgCheck,
                         final String gpgKey);  YumRepository(final String name); protected  YumRepository(); final URL getMirrorListUrl(); final boolean isGpgCheck(); final String getGpgKey(); @Override final Set<RPMRepoPackage> listRemotePackages(); @Override final void measurePackage(final RPMRepoPackage repoPackage,
                                     final int maxDownloadAttempts); final void measurePackage(final RPMRepoPackage repoPackage);  }### Answer:
@Test(groups = { "rhel-6" }) public void testListRemotePackages() throws RepositoryException { final Set<RPMRepoPackage> packages = repo.listRemotePackages(); Assert.assertNotNull(packages); Assert.assertTrue(packages.size() == PACKAGE_COUNT); for (RPMRepoPackage repoPackage : packages) { Assert.assertEquals(repoPackage.getName(), PACKAGE_NAME); } }