package apostov;

import java.util.function.Function;
import java.util.stream.Collectors;

import org.apache.commons.lang3.text.WordUtils;

import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;

public enum Value {
	
	TWO('2'),
	THREE('3'),
	FOUR('4'),
	FIVE('5'),
	SIX('6'),
	SEVEN('7'),
	EIGHT('8'),
	NINE('9'),
	TEN('T'),
	JACK('J'),
	QUEEN('Q'),
	KING('K'),
	ACE('A');
	
	private Value(final char shortName) {
		this.shortName = shortName;
	}
	
	public final char shortName;
	public static final ImmutableList<Value> asAscendingList = ImmutableList.copyOf(values());
	public static final ImmutableList<Value> asDescendingList = ImmutableList.copyOf(values()).reverse();
	public static final ImmutableMap<Character, Value> byShortName = ImmutableMap.copyOf(
			asAscendingList
			.stream()
			.collect(Collectors.toMap(Value::shortName, Function.identity())));
	
	/**
	 * @return the singular form of this Value, such as <tt>"Ace"</tt> or <tt>"King"</tt>.
	 */
	public String singular() {
		return WordUtils.capitalize(name());
	}	
	/**
	 * @return the plural form of this Value, such as <tt>"Aces"</tt> or <tt>"Kings"</tt>.
	 */
	public String plural() {
		return singular() + 's';
	}
	
	public Character shortName() {
		return shortName;
	}
}


@@ -719,25 +719,31 @@
 .copyOf(
-values())
+asAscendingList
 .reverse
@@ -744,16 +744,17 @@
 everse()
+)
 ;%0D%0A%09publ

Remove a little code-duplication in Value.java