### Question:
WorkingCopyPathUtil { public static int getProjectId( final String href ) { String requestPathInfo = StringUtils.defaultString( href ); requestPathInfo = removePrefix( requestPathInfo ); if ( requestPathInfo.startsWith( "/" ) ) { requestPathInfo = requestPathInfo.substring( 1 ); } int projectId = 0; try { int slash = requestPathInfo.indexOf( '/' ); if ( slash > 0 ) { projectId = Integer.parseInt( requestPathInfo.substring( 0, slash ) ); } else { projectId = Integer.parseInt( requestPathInfo ); } } catch ( NumberFormatException e ) { } return projectId; }  static String getLogicalResource( final String href ); static int getProjectId( final String href );  }### Answer:
@Test public void testGetProjectId() { String href = "/path/1/src/main/java"; assertEquals( 1, WorkingCopyPathUtil.getProjectId( href ) ); href = "path/2/src/test"; assertEquals( 2, WorkingCopyPathUtil.getProjectId( href ) ); }