@Override
  public Optional<ReadError> read(DbFileSources.Line.Builder lineBuilder) {
    if (readError == null) {
      try {
        processSymbols(lineBuilder);
      } catch (RangeOffsetConverter.RangeOffsetConverterException e) {
        readError = new ReadError(Data.SYMBOLS, lineBuilder.getLine());
        LOG.warn(format("Inconsistency detected in Symbols data. Symbols will be ignored for file '%s'", file.getKey()), e);
      }
    }
    return Optional.ofNullable(readError);
  }
@Test
  public void symbol_declaration_should_be_sorted_by_line() {
    SymbolsLineReader symbolsLineReader = newReader(
      newSymbol(
        newSingleLineTextRangeWithExpectedLabel(LINE_2, OFFSET_0, OFFSET_1, RANGE_LABEL_1),
        newSingleLineTextRangeWithExpectedLabel(LINE_3, OFFSET_2, OFFSET_3, RANGE_LABEL_2)),
      newSymbol(
        newSingleLineTextRangeWithExpectedLabel(LINE_1, OFFSET_0, OFFSET_1, RANGE_LABEL_1),
        newSingleLineTextRangeWithExpectedLabel(LINE_3, OFFSET_0, OFFSET_1, RANGE_LABEL_1)));

    assertThat(symbolsLineReader.read(line1)).isEmpty();
    symbolsLineReader.read(line2);
    symbolsLineReader.read(line3);

    assertThat(line1.getSymbols()).isEqualTo(RANGE_LABEL_1 + ",1");
    assertThat(line2.getSymbols()).isEqualTo(RANGE_LABEL_1 + ",2");
    assertThat(line3.getSymbols()).isEqualTo(RANGE_LABEL_1 + ",1;" + RANGE_LABEL_2 + ",2");
  }