void () { assertNull(StringUtil.getLineSeparatorAt("", -1)); assertNull(StringUtil.getLineSeparatorAt("", 0)); assertNull(StringUtil.getLineSeparatorAt("", 1)); assertNull(StringUtil.getLineSeparatorAt("\nHello", -1)); assertNull(StringUtil.getLineSeparatorAt("\nHello", 1)); assertNull(StringUtil.getLineSeparatorAt("\nH\rel\nlo", 6)); assertEquals(LineSeparator.LF, StringUtil.getLineSeparatorAt("\nHello", 0)); assertEquals(LineSeparator.LF, StringUtil.getLineSeparatorAt("\nH\rel\nlo", 5)); assertEquals(LineSeparator.LF, StringUtil.getLineSeparatorAt("Hello\n", 5)); assertEquals(LineSeparator.CR, StringUtil.getLineSeparatorAt("\rH\r\nelp", 0)); assertEquals(LineSeparator.CR, StringUtil.getLineSeparatorAt("Hello\r", 5)); assertEquals(LineSeparator.CR, StringUtil.getLineSeparatorAt("Hello\b\r", 6)); assertEquals(LineSeparator.CRLF, StringUtil.getLineSeparatorAt("\rH\r\nelp", 2)); assertEquals(LineSeparator.CRLF, StringUtil.getLineSeparatorAt("\r\nH\r\nelp", 0)); assertEquals(LineSeparator.CRLF, StringUtil.getLineSeparatorAt("\r\nH\r\nelp\r\n", 8)); }