### Question:
ManifestUtils { public static final Map<String, Map<String,String>> normalize(Manifest m) { Map<String, Map<String,String>> all = new HashMap<String, Map<String,String>>(); Attributes mainAtt = m.getMainAttributes(); all.put(MAIN_ATTS, normalize(mainAtt)); Map<String,Attributes> unwashed = m.getEntries(); Set<Map.Entry<String,Attributes>> entries = unwashed.entrySet(); for(Map.Entry<String,Attributes> entry : entries) { String name = entry.getKey(); Attributes value = entry.getValue(); if(name == null || value == null) continue; all.put(name, normalize(value)); } return all; } private  ManifestUtils(); static final Map<String, Map<String,String>> normalize(Manifest m); static final Map<String,String> normalize(Attributes att); static final String encode(String input); static Map<String,String> getMain(Map<String, Map<String,String>> exManifest); static String decode(String input); static final String EOL_TOKEN; static final String MAIN_ATTS; static final String EOL; }### Answer:
@Test public void normalize() { Manifest m = new Manifest(); String hasToken = "abc" + ManifestUtils.EOL_TOKEN + "def"; String convertedHasToken = "abc" + ManifestUtils.EOL + "def"; Attributes mainAtt = m.getMainAttributes(); Map<String,Attributes> entries = m.getEntries(); Attributes fooAtt = new Attributes(); entries.put("foo", fooAtt); fooAtt.putValue("fooKey", "fooValue"); fooAtt.putValue("fooKey2", hasToken); mainAtt.putValue("mainKey", "mainValue"); Map<String,Map<String,String>> norm = ManifestUtils.normalize(m); Map<String,String> normMainAtt = norm.get(ManifestUtils.MAIN_ATTS); Map<String,String> normFooAtt = norm.get("foo"); assertTrue(norm.size() == 2); assertNotNull(normMainAtt); assertNotNull(normFooAtt); assertTrue(normMainAtt.size() == 1); assertTrue(normFooAtt.size() == 2); assertFalse(normFooAtt.get("fooKey2").equals(hasToken)); assertTrue(normFooAtt.get("fooKey2").equals(convertedHasToken)); assertFalse(hasToken.equals(convertedHasToken)); assertEquals("mainValue", normMainAtt.get("mainKey")); }