### Question:
PathImpl implements Path { public static PathImpl createPathFromString(String propertyPath) { if ( propertyPath == null ) { throw new IllegalArgumentException( "null is not allowed as property path." ); } if ( propertyPath.length() == 0 ) { return createNewPath( null ); } return parseProperty( propertyPath ); } private  PathImpl(Path path); private  PathImpl(); private  PathImpl(List<Node> nodeList); static PathImpl createPathFromString(String propertyPath); static PathImpl createNewPath(String name); static PathImpl createShallowCopy(Path path); boolean isRootPath(); PathImpl getPathWithoutLeafNode(); void addNode(Node node); Node removeLeafNode(); NodeImpl getLeafNode(); Iterator<Path.Node> iterator(); boolean isSubPathOf(Path path); @Override String toString(); @Override boolean equals(Object o); @Override int hashCode();  }### Answer:
@Test(expectedExceptions = IllegalArgumentException.class) public void testNull() { PathImpl.createPathFromString( null ); }
@Test(expectedExceptions = IllegalArgumentException.class) public void testUnbalancedBraces() { PathImpl.createPathFromString( "foo[.bar" ); }
@Test(expectedExceptions = IllegalArgumentException.class) public void testIndexInMiddleOfProperty() { PathImpl.createPathFromString( "f[1]oo.bar" ); }
@Test(expectedExceptions = IllegalArgumentException.class) public void testTrailingPathSeperator() { PathImpl.createPathFromString( "foo.bar." ); }
@Test(expectedExceptions = IllegalArgumentException.class) public void testLeadingPathSeperator() { PathImpl.createPathFromString( ".foo.bar" ); }