@Test public void testGetInstance() throws Exception { assertTrue("Must be null safe", RegExUtils.getInstance(null).matches("null matches any string")); assertTrue("Must be miss-configuration proof", RegExUtils.getInstance(" ").matches("empty matches any string")); assertTrue("Must match regex as positive", RegExUtils.getInstance("\\d+").matches("111111")); assertFalse("Must not match regex as negative", RegExUtils.getInstance("\\d+").matches("111111a")); }
public static RegEx getInstance(final String pattern) { if (StringUtils.isBlank(pattern)) { return NULL; } return CACHE.computeIfAbsent(pattern, RegEx::new); }
RegExUtils { public static RegEx getInstance(final String pattern) { if (StringUtils.isBlank(pattern)) { return NULL; } return CACHE.computeIfAbsent(pattern, RegEx::new); } }
RegExUtils { public static RegEx getInstance(final String pattern) { if (StringUtils.isBlank(pattern)) { return NULL; } return CACHE.computeIfAbsent(pattern, RegEx::new); } private  RegExUtils(); }
RegExUtils { public static RegEx getInstance(final String pattern) { if (StringUtils.isBlank(pattern)) { return NULL; } return CACHE.computeIfAbsent(pattern, RegEx::new); } private  RegExUtils(); static RegEx getInstance(final String pattern); }
RegExUtils { public static RegEx getInstance(final String pattern) { if (StringUtils.isBlank(pattern)) { return NULL; } return CACHE.computeIfAbsent(pattern, RegEx::new); } private  RegExUtils(); static RegEx getInstance(final String pattern);  }