public static boolean isUnclosedQuote(final String line) {
    // CHECKSTYLE_RULES.ON: CyclomaticComplexity
    int quoteStart = -1;
    for (int i = 0; i < line.length(); ++i) {
      if (quoteStart < 0 && isQuoteChar(line, i)) {
        quoteStart = i;
      } else if (quoteStart >= 0 && isTwoQuoteStart(line, i) && !isEscaped(line, i)) {
        // Together, two quotes are effectively an escaped quote and don't act as a quote character.
        // Skip the next quote char, since it's coupled with the first.
        i++;
      } else if (quoteStart >= 0 && isQuoteChar(line, i) && !isEscaped(line, i)) {
        quoteStart = -1;
      }
    }
    final int commentInd = line.indexOf(COMMENT);
    if (commentInd < 0) {
      return quoteStart >= 0;
    } else if (quoteStart < 0) {
      return false;
    } else {
      return commentInd > quoteStart;
    }
  }
@Test
  public void shouldNotFindUnclosedQuote_containsDoubleQuote() {
    // Given:
    final String line = "some line 'this is \"in\" a quote'";

    // Then:
    assertThat(UnclosedQuoteChecker.isUnclosedQuote(line), is(false));
  }