class EolHelper {

    public static String getEndEol(String line) {
        if (line == null) {
            throw new IllegalArgumentException("Line argument cannot be null");
        }
        if (line.endsWith("\r\n")) return "\r\n";
        if (line.endsWith("\n")) return "\n";
        if (line.endsWith("\r")) return "\r";
        return null;
    }

}