AliasManager { @SuppressWarnings("unchecked") public String printAllAliases() { StringBuilder sb = new StringBuilder(); aliases.stream() .sorted() .forEach(a -> sb .append(ALIAS_SPACE) .append(a.toString()) .append(Config.getLineSeparator())); return sb.toString(); } AliasManager(File aliasFile, boolean persistAlias); boolean verifyNoNewAliasConflict(String aliasName); void persist(); @SuppressWarnings("unchecked") String printAllAliases(); Optional<Alias> getAlias(String name); Optional<String> getAliasName(String input); List<String> findAllMatchingNames(String name); List<String> getAllNames(); String removeAlias(String buffer); String parseAlias(String buffer); String aliasUsage(); String unaliasUsage();  }
@Test public void testPrintAllAliases() { String alias = "alias foo='bar'"; manager.parseAlias(alias); Assert.assertEquals(alias + Config.getLineSeparator(), manager.printAllAliases()); }