### Question:
WorkingCopyPathUtil { public static String getLogicalResource( final String href ) { String logicalResource = null; String requestPathInfo = StringUtils.defaultString( href ); requestPathInfo = removePrefix( requestPathInfo ); if ( requestPathInfo.startsWith( "/" ) ) { requestPathInfo = requestPathInfo.substring( 1 ); } int slash = requestPathInfo.indexOf( '/' ); if ( slash > 0 ) { logicalResource = requestPathInfo.substring( slash ); if ( logicalResource.endsWith( "/.." ) ) { logicalResource += "/"; } if ( logicalResource != null && logicalResource.startsWith( " { logicalResource = logicalResource.substring( 1 ); } if ( logicalResource == null ) { logicalResource = "/"; } } else { logicalResource = "/"; } return logicalResource; }  static String getLogicalResource( final String href ); static int getProjectId( final String href );  }### Answer:
@Test public void testGetLogicalPath() { String href = "/workingcopy/1/src/main/java/org/apache/maven/someartifact.jar"; assertEquals( "/src/main/java/org/apache/maven/someartifact.jar", WorkingCopyPathUtil.getLogicalResource( href ) ); href = "workingcopy/1/src/main/java/org/apache/maven/someartifact.jar"; assertEquals( "/src/main/java/org/apache/maven/someartifact.jar", WorkingCopyPathUtil.getLogicalResource( href ) ); href = "workingcopy/1/src/main/java/"; assertEquals( "/src/main/java/", WorkingCopyPathUtil.getLogicalResource( href ) ); href = "workingcopy"; assertEquals( "/", WorkingCopyPathUtil.getLogicalResource( href ) ); }