public static boolean equalsToIgnoreEndline(String expected, String actual) {
		if (expected == null && actual == null) {
			return true;
		}
		if (expected != null ^ actual != null) {
			return false;
		}
		Scanner scanner1 = new Scanner(expected);
		Scanner scanner2 = new Scanner(actual);
		String line1, line2;
		while (scanner1.hasNextLine()) {
			line1 = scanner1.nextLine();
			line2 = scanner2.nextLine();
			if (! line1.equals(line2)) {
				scanner1.close();
				scanner2.close();
				return false;
			}
		}
		if (scanner2.hasNextLine()) {
			scanner1.close();
			scanner2.close();
			return false;
		}

		scanner1.close();
		scanner2.close();
		return true;
	}
public static boolean equalsToIgnoreEndline ( String expected , String actual ) { if ( expected == null && actual == null ) { return true ; } if ( expected != null ^ actual != null ) { return false ; } Scanner scanner1 = new Scanner ( expected ) ; Scanner scanner2 = new Scanner ( actual ) ; String line1 , line2 ; while ( scanner1 . hasNextLine ( ) ) { line1 = scanner1 . nextLine ( ) ; line2 = scanner2 . nextLine ( ) ; if ( ! line1 . equals ( line2 ) ) { scanner1 . close ( ) ; scanner2 . close ( ) ; return false ; } } if ( scanner2 . hasNextLine ( ) ) { scanner1 . close ( ) ; scanner2 . close ( ) ; return false ; } scanner1 . close ( ) ; scanner2 . close ( ) ; return true ; }
compares two strings for equality, line by line, ignoring any difference
of end line delimiters contained within the 2 Strings. This method should
be used if and only if two Strings are considered identical when all nodes
are identical including their relative order. Generally useful when
asserting identity of <b>automatically regenerated</b> XML or PDB.

@param expected
@param actual