MapCondition extends BasicCondition<T, MapCondition<T, K, V>> implements MapChecks<T, K, V, MapCondition<T, K, V>> { @Override public MapCondition<T, K, V> hasSizeGreaterThan(int minSizeExclusive) { require(this.subject).isNotNull(); if (!(this.subject.size() > minSizeExclusive)) { DbcAssertionError.throwNew(new IllegalStateException("Expected map size to be greater than <" + minSizeExclusive + "> but was <" + this.subject.size() + ">"), this.message); } return result(); } MapCondition(T subject); @Override MapCondition<T, K, V> isNotEmpty(); @Override MapCondition<T, K, V> hasSize(int size); @Override MapCondition<T, K, V> hasSizeBetween(int startInclusive, int endInclusive); @Override MapCondition<T, K, V> containsKey(K key); @Override MapCondition<T, K, V> containsValue(V value); @Override MapCondition<T, K, V> hasSizeGreaterThan(int minSizeExclusive); @Override MapCondition<T, K, V> hasSizeGreaterThanOrEqual(int minSize); @Override MapCondition<T, K, V> hasSizeLessThan(int maxSizeExclusive); @Override MapCondition<T, K, V> hasSizeLessThanOrEqual(int maxSize);  }
@Test public void hasSizeGreaterThan() throws Exception { MapCondition<Map<String, String>, String, String> condition = new MapCondition<>(this.input); condition.hasSizeGreaterThan(2); Assertions.assertThatThrownBy(() -> condition.hasSizeGreaterThan(3)) .isInstanceOf(DbcAssertionError.class) .hasCauseInstanceOf(IllegalStateException.class); }