private static boolean isOneEOFText(String text) {
    int eof = text.indexOf('\n');
    return eof != -1 && eof == text.lastIndexOf('\n') && text.trim().isEmpty();
  }
private static boolean isOneEOFText(String text)