    001package com.hammurapi.store;
    002
    003import java.util.Comparator;
    004
    005/**
    006 * Convenience class which compares objects according
    007 * natural order.
    008 * @author Pavel Vlasov
    009 *
    010 * @param <V>
    011 */
    012public class NaturalComparator<V> implements Comparator<V> {
    013        @SuppressWarnings("unchecked")
    014        @Override
    015        public int compare(V o1, V o2) {
    016                return ((Comparable<V>) o1).compareTo(o2);
    017        }
    018}
    019