### Question:
ValidatorUtils { public static void checkContextPath(String contextPath) { if (contextPath == null) { return; } Matcher matcher = CONTEXT_PATH_MATCH.matcher(contextPath); if (matcher.find()) { throw new IllegalArgumentException("Illegal url path expression"); } }  static void checkInitParam(Properties properties); static void checkContextPath(String contextPath);  }### Answer:
@Test(expected = IllegalArgumentException.class) public void testContextPathIllegal1() { String contextPath1 = " ValidatorUtils.checkContextPath(contextPath1); }
@Test(expected = IllegalArgumentException.class) public void testContextPathIllegal2() { String contextPath2 = "/nacos ValidatorUtils.checkContextPath(contextPath2); }
@Test(expected = IllegalArgumentException.class) public void testContextPathIllegal3() { String contextPath3 = " ValidatorUtils.checkContextPath(contextPath3); }
@Test(expected = IllegalArgumentException.class) public void testContextPathIllegal4() { String contextPath4 = " ValidatorUtils.checkContextPath(contextPath4); }
@Test public void testContextPathLegal() { String contextPath1 = "/nacos"; ValidatorUtils.checkContextPath(contextPath1); String contextPath2 = "nacos"; ValidatorUtils.checkContextPath(contextPath2); String contextPath3 = "/"; ValidatorUtils.checkContextPath(contextPath3); String contextPath4 = ""; ValidatorUtils.checkContextPath(contextPath4); }