### Question:
ContinuumUrlValidator implements Configurable { public URLUserInfo extractURLUserInfo( String url ) throws URISyntaxException { URI uri = new URI( url ); String userInfoRaw = uri.getUserInfo(); URLUserInfo urlUserInfo = new URLUserInfo(); if ( !StringUtils.isEmpty( userInfoRaw ) ) { int index = userInfoRaw.indexOf( ':' ); if ( index >= 0 ) { urlUserInfo.setUsername( userInfoRaw.substring( 0, index ) ); urlUserInfo.setPassword( userInfoRaw.substring( index + 1, userInfoRaw.length() ) ); } else { urlUserInfo.setUsername( userInfoRaw ); } } return urlUserInfo; } ContinuumUrlValidator();  ContinuumUrlValidator( String[] schemes ); boolean validate( String value ); boolean isValid( String value ); URLUserInfo extractURLUserInfo( String url ); void configure( PlexusConfiguration plexusConfiguration );  }### Answer:
@Test public void testExtractUserNamePwd() throws Exception { ContinuumUrlValidator continuumUrlValidator = new ContinuumUrlValidator(); URLUserInfo usrInfo = continuumUrlValidator.extractURLUserInfo( "https: assertEquals( "username", usrInfo.getUsername() ); assertEquals( "password", usrInfo.getPassword() ); }
@Test public void testExtractUserNameEmptyPwd() throws Exception { ContinuumUrlValidator continuumUrlValidator = new ContinuumUrlValidator(); URLUserInfo usrInfo = continuumUrlValidator.extractURLUserInfo( "https: assertEquals( "username", usrInfo.getUsername() ); assertNull( usrInfo.getPassword() ); }
@Test public void testExtractEmptyUserNameEmptyPwd() throws Exception { ContinuumUrlValidator continuumUrlValidator = new ContinuumUrlValidator(); URLUserInfo usrInfo = continuumUrlValidator.extractURLUserInfo( "https: assertNull( usrInfo.getUsername() ); assertNull( usrInfo.getPassword() ); }