private int containsChar(final String str, final char chr) {
        int cnt = 0;
        if (str != null) {
            int idx = 0;
            for (; ; ) {
                idx = str.indexOf(chr, idx);
                if (idx == -1) {
                    break;
                } else {
                    cnt++;
                    if (idx < str.length() - 1) {
                        idx++;
                    } else {
                        break;
                    }
                }
            }
        }
        return cnt;
    }
@return The number of times chr appears in str.
stroom-pipeline/src/test/java/stroom/pipeline/reader/TestInvalidXMLCharFilterReaderElement.java