NumericRangeFilterBuilder filterBuilder = new NumericRangeFilterBuilder();
filterBuilder.setStrictMode(true);
String xml = "<NumericRangeFilter fieldName='AGE' type='LoNg' lowerTerm='-2321' upperTerm='60000000'/>";
Document doc = getDocumentFromString(xml);
Filter filter = filterBuilder.getFilter(doc.getDocumentElement());
assertTrue(filter instanceof NumericRangeFilter<?>);
NumericRangeFilter<Long> numRangeFilter = (NumericRangeFilter) filter;
assertEquals(Long.valueOf(-2321L), numRangeFilter.getMin());
assertEquals(Long.valueOf(60000000L), numRangeFilter.getMax());
assertEquals("AGE", numRangeFilter.getField());
assertTrue(numRangeFilter.includesMin());
assertTrue(numRangeFilter.includesMax());
String xml2 = "<NumericRangeFilter fieldName='AGE' type='LoNg' lowerTerm='-2321' upperTerm='60000000' includeUpper='false'/>";
Document doc2 = getDocumentFromString(xml2);
Filter filter2 = filterBuilder.getFilter(doc2.getDocumentElement());
assertTrue(filter2 instanceof NumericRangeFilter<?>);
NumericRangeFilter<Long> numRangeFilter2 = (NumericRangeFilter) filter2;
assertEquals(Long.valueOf(-2321L), numRangeFilter2.getMin());
assertEquals(Long.valueOf(60000000L), numRangeFilter2.getMax());
assertEquals("AGE", numRangeFilter2.getField());