### Question:
ZKStore implements KVStore { static String getParentName(String path) { PathUtils.validatePath(path); if (path.equals("/")) return path; return path.substring(0, path.lastIndexOf('/')); } ZKStore(ZooKeeper zooKeeper); @Override Node get(String key); @Override List<Node> list(String prefix); @Override List<String> listKeys(String prefix); @Override long put(String key, String value); @Override long put(String key, String value, boolean ephemeral); @Override long delete(String key); @Override boolean exists(String key); @Override void watchChildren(String key, BiConsumer<Event, Node> consumer); @Override void watchChildren(String key, Supplier<Boolean> exitSignSupplier, BiConsumer<Event, Node> consumer); @Override void createParentNode(String parentNode); @Override void close();  }### Answer:
@Test public void testGetParentNameSuccessfully() { assertEquals("/", ZKStore.getParentName("/")); assertEquals("/test/folder", ZKStore.getParentName("/test/folder/name")); }
@Test(expected = IllegalArgumentException.class) public void testGetParentNameFailed() { ZKStore.getParentName("/test/folder fail(); }