public boolean filter(char[] content, int offset, int length) {
        if (content == null) {
            return false;
        }

        boolean filtered = false;
        for (int i = offset; i < offset + length; i++) {
            if (isFiltered(content[i])) {
                filtered = true;
                content[i] = REPLACEMENT_CHAR;
            }
        }

        if (filtered) {
            LOG.warn("Identified and replaced non-XML chars");
        }

        return filtered;
    }
@Test
    public void testFilter1ArgNonFiltered() {
        when(nonXmlCharFiltererMock.filter(anyString())).thenCallRealMethod();
        when(nonXmlCharFiltererMock.filter(any(char[].class), anyInt(), anyInt())).thenReturn(false);

        String string = "abc";
        String result = nonXmlCharFiltererMock.filter(string);

        verify(nonXmlCharFiltererMock).filter(new char[] { 'a', 'b', 'c' }, 0, 3);

        assertSame(string, result, "Should have returned the same string if nothing was filtered");
    }