ProxyHelper { static String convertToJavaPattern( String pattern ) { String javaPattern = pattern; if ( StringUtils.isNotBlank( pattern ) ) { javaPattern = javaPattern.replaceAll( "\\.", "\\\\." ); javaPattern = javaPattern.replaceAll( "\\*", ".*" ); } log.debug( "convertToJavaPattern: javaPattern = '{}'", javaPattern ); return javaPattern; } private  ProxyHelper(  ); static Proxy getProxy( String url ); static final String DEFAULT_PROTOCOL; }
@Test public void testConvertToJavaPattern( ) { String javaPattern = ProxyHelper.convertToJavaPattern( PATTERN ); String expected = "localhost|.*\\.my\\.company|192\\.168\\..*|127\\.0\\.0\\.1"; assertEquals( "javaPattern", expected, javaPattern ); }