ThresholdPolicyCount implements ThresholdPolicy<T> { @Override public boolean isThresholdExceeded() { return (count >= threshold); } ThresholdPolicyCount(long threshold); @Override void increment(T item); @Override boolean isThresholdExceeded(); @Override void reset(); long getThreshold(); long getCount(); @Override String toString();  }
@Test public void count_01() { ThresholdPolicyCount<String> policy = new ThresholdPolicyCount<>(0); assertTrue(policy.isThresholdExceeded()); }
@Test public void count_02() { ThresholdPolicyCount<String> policy = new ThresholdPolicyCount<>(1); assertFalse(policy.isThresholdExceeded()); }