### Question:
ParseTools { public static boolean isEscaped(final char[] chars, final int cursor) { Assert.notNull(chars, "Character input array must not be null."); Assert.assertTrue(cursor >= 0, "Start position must be greater than zero."); Assert.assertTrue(cursor < (chars.length), "Start position must be within the array upper bound."); if ((cursor > 0) && (chars[cursor - 1] == ESCAPE_CHAR)) { if ((cursor == 1) || ((cursor > 1) && (chars[cursor - 2] != ESCAPE_CHAR))) { return true; } } return false; }  static CapturingGroup balancedCapture(final char[] chars, final int startPos, final int endPos,
            final CaptureType type); static boolean isEscaped(final char[] chars, final int cursor);  }### Answer:
@Test public void testIsEscapedReturnsTrueWhenCharacterIsEscaped() throws Exception { Assert.assertTrue(ParseTools.isEscaped("/foo{bar\\}}".toCharArray(), 9)); }
@Test public void testIsEscapedReturnsTrueWhenSecondCharacterIsEscaped() throws Exception { Assert.assertTrue(ParseTools.isEscaped("\\{".toCharArray(), 1)); }
@Test public void testIsEscapedReturnsFalseWhenCharacterIsDoubleEscaped() throws Exception { Assert.assertFalse(ParseTools.isEscaped("/foo{bar\\\\}}".toCharArray(), 10)); }
@Test public void testIsEscapedReturnsTrueWhenCharacterIsTripleEscaped() throws Exception { Assert.assertFalse(ParseTools.isEscaped("/foo{bar\\\\\\}}".toCharArray(), 11)); }
@Test public void testIsEscapedReturnsFalseWhenCharacterIsQuadrupleEscaped() throws Exception { Assert.assertFalse(ParseTools.isEscaped("/foo{bar\\\\\\\\}}".toCharArray(), 12)); }