### Question:
RangeMap extends TreeMap<K, Collection<V>> { public List<V> getValues(K seed, ComparisonType comparisonType) { List<V> values = new ArrayList<>(); if (comparisonType == ComparisonType.EQUALS) { values.addAll(get(seed)); return values; } double v = seed.doubleValue(); boolean startCollecting = false; for (Map.Entry<K, Collection<V>> entry : this.entrySet()) { if (startCollecting) { values.addAll(entry.getValue()); continue; } double v1 = entry.getKey().doubleValue(); boolean smaller = v1 < v; boolean smallerEquals = v1 <= v; boolean bigger = v1 > v; boolean biggerEquals = v1 >= v; if ((comparisonType == ComparisonType.LESS && smaller) || (comparisonType == ComparisonType.LESS_EQUALS && smallerEquals) || (comparisonType == ComparisonType.MORE && bigger) || (comparisonType == ComparisonType.MORE_EQUALS && biggerEquals)) { values.addAll(entry.getValue()); if (comparisonType == ComparisonType.MORE || comparisonType == ComparisonType.MORE_EQUALS) { startCollecting = true; } } } return values; }  List<V> getValues(K seed, ComparisonType comparisonType); List<V> getValuesBetween(K lowerBound, K upperBound); void put(K key, V c);  }### Answer:
@Test public void testGetValues() throws Exception { assertThat(rm.getValues(4.9,ComparisonType.EQUALS), Matchers.hasItem("C")); assertThat(rm.getValues(4.9,ComparisonType.EQUALS).size(), Matchers.equalTo(1)); assertThat(rm.getValues(1.1,ComparisonType.LESS), Matchers.hasItem("A")); assertThat(rm.getValues(1.1,ComparisonType.LESS).size(), Matchers.equalTo(1)); assertThat(rm.getValues(3.3,ComparisonType.LESS_EQUALS), Matchers.hasItems("A","B")); assertThat(rm.getValues(3.3,ComparisonType.LESS_EQUALS).size(), Matchers.equalTo(2)); assertThat(rm.getValues(4.9,ComparisonType.MORE), Matchers.hasItem("D")); assertThat(rm.getValues(4.9,ComparisonType.MORE).size(), Matchers.equalTo(1)); assertThat(rm.getValues(4.9,ComparisonType.MORE_EQUALS), Matchers.hasItems("D","C")); assertThat(rm.getValues(4.9,ComparisonType.MORE_EQUALS).size(), Matchers.equalTo(2)); }