@Test
public void formatRecord_filterValueContainsUnicodeReplacementCharacter_replacementCharacterIsEscaped() {

    // given
    QueryRecordDto queryRecordDto = getQueryRecordDto();
    QueryFilterDto queryFilterDto = getQueryFilterDto("theValue" + '\ufffd');
    queryRecordDto.getQuery().getFilters().add(queryFilterDto);
    // when
    String formatted = formatter.formatRecord(queryRecordDto);
    // then
    assertNotEquals("Formatted query still contains unicode character",
            "query().filter(\"null >\", theValue�)", formatted);
    assertEquals("Formatted query does not contain escaped unicode character",
            "query().filter(\"null >\", theValue\\ufffd)", formatted);
}