ZkKeyBuilder { static String parseIdFromPath(String path) { if (!Strings.isNullOrEmpty(path)) return path.substring(path.lastIndexOf("/") + 1); return null; } ZkKeyBuilder(String pathPrefix); String getRootPath();  }
@Test public void testParseIdFromPath() { Assert.assertEquals( "1", ZkKeyBuilder.parseIdFromPath("/test/processors/" + "1")); Assert.assertNull(ZkKeyBuilder.parseIdFromPath(null)); Assert.assertNull(ZkKeyBuilder.parseIdFromPath("")); }