public static void assertExpectedOutputEndsWith(String expectedString,String x){
  int beginIndex=x.length() - expectedString.length();
  if (beginIndex < 0)   beginIndex=0;
  String gotThisOutput=x.substring(beginIndex);
  assertEquals("Output differs",expectedString,gotThisOutput);
}

public static void assertExpectedOutputEndsWith ( String expectedString , String x ) { int beginIndex = x . length ( ) - expectedString . length ( ) ; if ( beginIndex < 0 ) beginIndex = 0 ; String gotThisOutput = x . substring ( beginIndex ) ; assertEquals ( "Output differs" , expectedString , gotThisOutput ) ; }
ensured string x ends with expectedstring
