ArgExtractorHelper { static String trimGenericsAreaIfNestedGenericsExists(String target) { Assertion.on("target").mustNotBeNull(target); if (target.matches(RegExp.Anything_OneOrMore_Min + NESTED_GENERICS_MARK + RegExp.Anything_OneOrMore_Min)) { return target.replaceAll(RegExp.Generics, StringValue.Empty); } return target; } private  ArgExtractorHelper();   }
@Test public void trimGenericsAreaIfNestedGenericsExists_A$String() throws Exception { String target = "List<Map" + ArgExtractorHelper.NESTED_GENERICS_MARK + "> aaa"; String actual = ArgExtractorHelper.trimGenericsAreaIfNestedGenericsExists(target); String expected = "List aaa"; assertEquals(expected, actual); }
@Test public void trimGenericsAreaIfNestedGenericsExists_A$String_StringIsNull() throws Exception { String target_ = null; try { ArgExtractorHelper.trimGenericsAreaIfNestedGenericsExists(target_); fail(); } catch (JUnitHelperCoreException e) { } }
@Test public void trimGenericsAreaIfNestedGenericsExists_A$String_StringIsEmpty() throws Exception { String target_ = ""; String actual = ArgExtractorHelper.trimGenericsAreaIfNestedGenericsExists(target_); String expected = ""; assertThat(actual, is(equalTo(expected))); }