if (i < l && line.charAt(i+1) == '\n') {
if ((i < l - 1) && line.charAt(i+1) == '\n') {
	private static int countEmptyLines(String line) {		int emptyLines= 0;		int l= line.length();		for (int i= 0; i < l; i++) {			char c= line.charAt(i);			if (c == '\r') {				if (i < l && line.charAt(i+1) == '\n') {					emptyLines++;					i++;				}			} else if (c == '\n')				emptyLines++;		}		return emptyLines;	}