TIntHashSet excludeTerms = new TIntHashSet();
excludeTerms.add(HashedStringFieldType.hashCode("xxx"));
Pattern excludePattern = Pattern.compile("\\d{3}|a"); // the a is to test full token matching
HashedStringFieldType type = new HashedStringFieldType(
new HashedStringFieldData.HashedStringTypeLoader(0,0, excludePattern,excludeTerms));
// we exclude the only multi value, expect a single value array
SingleValueHashedStringFieldData sFieldData = (SingleValueHashedStringFieldData) type.load(reader, "mvalue");
assert (sFieldData.fieldName().equals("mvalue"));
assert (!sFieldData.multiValued());
assertThat(sFieldData.collisions(),equalTo(0));