// Collection of code snippets by Arne Vajhøj 
// (from articles on eksperten.dk / vajhoej.dk written sometime between 2004 and now) 
public class S12 {
    public enum Suits { CLUBS, SPADES, HEARTS, DIAMONDS }
    public static void test1(Suits s) {
        switch(s) {
            case CLUBS, SPADES -> System.out.println("Black");
            case HEARTS, DIAMONDS -> System.out.println("Red");
        }
    }
    public static void test2(Suits s) {
        int val = switch(s) {
            case CLUBS -> 1;
            case SPADES -> 4;
            case HEARTS -> 3;
            case DIAMONDS -> 2;
        };
        System.out.println(val);
    }
    public static void main(String[] args) {
        test1(Suits.SPADES);
        test2(Suits.SPADES);
    }
}
