class 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;
    }

}