OpmUtils { static String getAlias(String s) { Matcher matcher = pattern.matcher(s); if (!matcher.matches()) { throw new IllegalArgumentException("Invalid Syntax, no Alias found in String '" + s + "'. Syntax is ${xxx}"); } return matcher.group(ADDRESS); } private  OpmUtils();   }
@Test public void getAlias_illegalString_throws() { assertThatThrownBy(() -> OpmUtils.getAlias("hallo")) .isInstanceOf(IllegalArgumentException.class); }
@Test public void getAlias_matches() { String alias = OpmUtils.getAlias("${hallo}"); assertEquals("hallo", alias); }