BetweenEvaluator extends Evaluator<T> { @Override protected TruthValue evaluate(T value) { if (value == null) { return TruthValue.NULL; } int minCompare = minLiteral.compareTo(value); int maxCompare = maxLiteral.compareTo(value); if (minCompare <= 0 && maxCompare >= 0) { return TruthValue.YES; } return TruthValue.NO; } BetweenEvaluator(String fieldName, Comparable<T> minLiteral, Comparable<T> maxLiteral);   }
@Test public void lessThan() { when(corc.getWritable(COL0)).thenReturn(ZERO); assertThat(evaluator.evaluate(corc), is(TruthValue.NO)); }
@Test public void equalsMin() { when(corc.getWritable(COL0)).thenReturn(ONE); assertThat(evaluator.evaluate(corc), is(TruthValue.YES)); }
@Test public void middle() { when(corc.getWritable(COL0)).thenReturn(TWO); assertThat(evaluator.evaluate(corc), is(TruthValue.YES)); }
@Test public void equalsMax() { when(corc.getWritable(COL0)).thenReturn(THREE); assertThat(evaluator.evaluate(corc), is(TruthValue.YES)); }
@Test public void greaterThan() { when(corc.getWritable(COL0)).thenReturn(FOUR); assertThat(evaluator.evaluate(corc), is(TruthValue.NO)); }
@Test public void nullInput() { when(corc.getWritable(COL0)).thenReturn(null); assertThat(evaluator.evaluate(corc), is(TruthValue.NULL)); }