### Question:
SvgSanitizer { public static String sanitize(String svg){ svg = removeXMLNS(svg); svg = removeDuplicateXmlnsXlink(svg); svg = removeNS1(svg); return svg; }  static String sanitize(String svg);  }### Answer:
@Test void sanitize_withTwoXmlns_RemovesSuperfluousXmlns(){ String expectedSVG = "<svg height=\"1000\" width=\"1583\" xmlns:xlink=\"http: String inputSVG = "<svg xmlns=\"http: assertEquals(expectedSVG, SvgSanitizer.sanitize(inputSVG)); }
@Test void sanitize_withTwoXmlnsInImageTagAndOneInSvgTag_RemovesSuperfluousXmlnsInImageTag() { String expectedSVG = "<svg id=\"SvgjsSvg1298\" xmlns:xlink=\"http: String inputSVG = "<svg id=\"SvgjsSvg1298\" xmlns:xlink=\"http: assertEquals(expectedSVG, SvgSanitizer.sanitize(inputSVG)); }
@Test void sanitize_withSingleXmlns_DoesNotModifySVG(){ String expectedSVG = "<svg height=\"1000\" width=\"1583\" xmlns:xlink=\"http: String inputSVG = expectedSVG; assertEquals(expectedSVG, SvgSanitizer.sanitize(inputSVG)); }
@Test void sanitize_withNS1_RemovesNS1(){ String expectedSVG = "<svg id=\"SvgjsSvg1106\" style=\"overflow: visible;\" width=\"1369\" height=\"1637\" xmlns=\"http: String inputSVG = "<svg id=\"SvgjsSvg1106\" style=\"overflow: visible;\" width=\"1369\" height=\"1637\" xmlns=\"http: assertEquals(expectedSVG, SvgSanitizer.sanitize(inputSVG)); }
@Test void sanitize_withoutNS1_DoesNotModifySVG(){ String expectedSVG = "<svg id=\"SvgjsSvg1106\" style=\"overflow: visible;\" width=\"1369\" height=\"1637\" xmlns=\"http: String inputSVG = "<svg id=\"SvgjsSvg1106\" style=\"overflow: visible;\" width=\"1369\" height=\"1637\" xmlns=\"http: assertEquals(expectedSVG, SvgSanitizer.sanitize(inputSVG)); }