WSPlaceholderUtil { public static String removeEndTags( String s ) { return endTagRE.matcher( s ).replaceAll( "" ); }  static String replacePlaceholders( String s, Map<Integer, PHData> phmap ); static Map<Integer, PHData> makePlaceholderMap( WSTextSegmentPlaceholder[] holders ); static String restorePlaceholders( String s, Map<Integer, PHData> phmap ); static String findEndTagsAtBeginning( String s ); static String removeEndTags( String s );  }
@Test public void testRemoveEndTags() { assertEquals( "No extra tags", "Hello", WSPlaceholderUtil.removeEndTags( "Hello" ) ); assertEquals( "One extra tags", "Hello", WSPlaceholderUtil.removeEndTags( "Hello</span>" ) ); assertEquals( "Two extra tags", "Hello", WSPlaceholderUtil.removeEndTags( "Hello</span></span>" ) ); assertEquals( "Two extra tags and extra space in between", "Hello", WSPlaceholderUtil.removeEndTags( "Hello</span> </span>" ) ); }