@Test public void testMultiLetterRange() { WordRange range = new WordRange("bbb-bdd"); Assert.assertFalse(range.apply("ba")); Assert.assertFalse(range.apply("bba")); Assert.assertTrue(range.apply("bbb")); Assert.assertTrue(range.apply("bcc")); Assert.assertTrue(range.apply("bdd")); Assert.assertFalse(range.apply("bde")); Assert.assertFalse(range.apply("be")); }
@Override public boolean apply(String string) { String lower = string.toLowerCase(); Map.Entry<String, String> entry = ranges.floorEntry(lower); return entry != null && lower.compareTo(entry.getValue()) <= 0; }
WordRange implements Predicate<String> { @Override public boolean apply(String string) { String lower = string.toLowerCase(); Map.Entry<String, String> entry = ranges.floorEntry(lower); return entry != null && lower.compareTo(entry.getValue()) <= 0; } }
WordRange implements Predicate<String> { @Override public boolean apply(String string) { String lower = string.toLowerCase(); Map.Entry<String, String> entry = ranges.floorEntry(lower); return entry != null && lower.compareTo(entry.getValue()) <= 0; } WordRange(String rangeString); }
WordRange implements Predicate<String> { @Override public boolean apply(String string) { String lower = string.toLowerCase(); Map.Entry<String, String> entry = ranges.floorEntry(lower); return entry != null && lower.compareTo(entry.getValue()) <= 0; } WordRange(String rangeString); @Override boolean apply(String string); @Override @JsonValue String toString(); }
WordRange implements Predicate<String> { @Override public boolean apply(String string) { String lower = string.toLowerCase(); Map.Entry<String, String> entry = ranges.floorEntry(lower); return entry != null && lower.compareTo(entry.getValue()) <= 0; } WordRange(String rangeString); @Override boolean apply(String string); @Override @JsonValue String toString();  }