### Question:
Main { static Matcher validateZkUrl(final String zkUrl) { final Matcher matcher = zkURLPattern.matcher(zkUrl); if (!matcher.matches()) { throw new SystemExitException(String.format("Invalid zk url format: '%s' expected '%s'", zkUrl, validZkUrl), 7); } return matcher; }  static void main(final String[] args);  }### Answer:
@Test public void testZkDirectoryDepth1() throws Exception { final Matcher m = validateZkUrl("zk: assertThat(m.group(1)).isEqualTo("host:2181"); assertThat(m.group(2)).isEqualTo("/cassandra-mesos"); }
@Test public void testZkDirectoryDepth2() throws Exception { final Matcher m = validateZkUrl("zk: assertThat(m.group(1)).isEqualTo("host:2181"); assertThat(m.group(2)).isEqualTo("/cassandra-mesos/ring1"); }
@Test public void testZkDirectoryDepth3() throws Exception { final Matcher m = validateZkUrl("zk: assertThat(m.group(1)).isEqualTo("host:2181"); assertThat(m.group(2)).isEqualTo("/cassandra-mesos/a/b/c"); }
@Test public void testZkDirectoryDepth4() throws Exception { final Matcher m = validateZkUrl("zk: assertThat(m.group(1)).isEqualTo("host:2181"); assertThat(m.group(2)).isEqualTo("/cassandra-mesos/a/b/c/d"); }
@Test public void test2Hosts() throws Exception { final Matcher m = validateZkUrl("zk: assertThat(m.group(1)).isEqualTo("host1:2181,host2:2181"); assertThat(m.group(2)).isEqualTo("/cassandra-mesos/a/b/c/d"); }
@Test public void test3Hosts() throws Exception { final Matcher m = validateZkUrl("zk: assertThat(m.group(1)).isEqualTo("host1:2181,host2:2181,host3:2181"); assertThat(m.group(2)).isEqualTo("/cassandra-mesos/a/b/c/d"); }
@Test(expected = SystemExitException.class) public void testMissingScheme() throws Exception { validateZkUrl("host1:2181/cassandra-mesos"); }
@Test(expected = SystemExitException.class) public void testMissingDir() throws Exception { validateZkUrl("zk: }
@Test(expected = SystemExitException.class) public void testTrailingSlash() throws Exception { validateZkUrl("zk: }