### Question:
InfluxDBJvmTagParser { public static Map<String, String> parse(String jvmTags) throws IllegalArgumentException { if (jvmTags == null || jvmTags.isEmpty()) { return Collections.EMPTY_MAP; } String[] tagValuePairs = jvmTags.split(","); Map<String, String> result = new HashMap<>(); for (String tagValuePair : tagValuePairs) { String[] tagValueSplit = tagValuePair.split("="); if (tagValueSplit.length != 2) { throw new IllegalArgumentException("jvmTags is in an invalid format. " + "Multiple Tag/Value pairs must be delimited by ','. " + "A tag/value pair must be separated with an '='. jvmTag input was '" + jvmTags + "'"); } String tagName = tagValueSplit[0]; if (tagName.isEmpty()) { throw new IllegalArgumentException("A tag name is empty. jvmTag input was '" + jvmTags + "'"); } String value = tagValueSplit[1]; if (value.isEmpty()) { throw new IllegalArgumentException("The tag value for tag name '" + tagName + "' is empty. Full jvmTag input was '" + jvmTags + "'"); } result.put(tagName, value); } return result; }  static Map<String, String> parse(String jvmTags);  }### Answer:
@Test public void testNullInput() { Assert.assertEquals(Collections.EMPTY_MAP, new InfluxDBJvmTagParser().parse(null)); }
@Test(expected = IllegalArgumentException.class) public void testNoEqualsSign() { InfluxDBJvmTagParser.parse("iDontContainAnEqualsSign"); }
@Test(expected = IllegalArgumentException.class) public void testLeadsWithEqualsSign() { InfluxDBJvmTagParser.parse("=iLeadWithAnEqualsSign"); }
@Test(expected = IllegalArgumentException.class) public void testMultipleEqualsSignsWithNoDelimeter() { InfluxDBJvmTagParser.parse("tag1=value1 tag2=value2"); }
@Test(expected = IllegalArgumentException.class) public void testMultipleEqualsSignsWithIncorrectDelimeter() { InfluxDBJvmTagParser.parse("tag1=value1;tag2=value2"); }
@Test() public void testSingleTag() { Map<String, String> result = InfluxDBJvmTagParser.parse("tag1=value1"); Assert.assertEquals(1, result.size()); Assert.assertEquals("value1", result.get("tag1")); }
@Test() public void testMultipleTags() { Map<String, String> result = InfluxDBJvmTagParser.parse("tag1=value1,tag2=value2,tag3=value3"); Assert.assertEquals(3, result.size()); Assert.assertEquals("value1", result.get("tag1")); Assert.assertEquals("value2", result.get("tag2")); Assert.assertEquals("value3", result.get("tag3")); }