import org.junit.Ignore;
import org.junit.Test;

import static java.util.Arrays.asList;
import static java.util.Collections.emptyList;
import static java.util.Collections.singletonList;
import static org.junit.Assert.assertEquals;

public final class HandshakeCalculatorTest {

    @Test
    public void testThatInput1YieldsAWink() {
        assertEquals(
                singletonList(Signal.WINK),
                new HandshakeCalculator().calculateHandshake(1));
    }

    @Ignore
    @Test
    public void testThatInput2YieldsADoubleBlink() {
        assertEquals(
                singletonList(Signal.DOUBLE_BLINK),
                new HandshakeCalculator().calculateHandshake(2));
    }

    @Ignore
    @Test
    public void testThatInput4YieldsACloseYourEyes() {
        assertEquals(
                singletonList(Signal.CLOSE_YOUR_EYES),
                new HandshakeCalculator().calculateHandshake(4));
    }

    @Ignore
    @Test
    public void testThatInput8YieldsAJump() {
        assertEquals(
                singletonList(Signal.JUMP),
                new HandshakeCalculator().calculateHandshake(8));
    }

    @Ignore
    @Test
    public void testAnInputThatYieldsTwoActions() {
        assertEquals(
                asList(Signal.WINK, Signal.DOUBLE_BLINK),
                new HandshakeCalculator().calculateHandshake(3));
    }

    @Ignore
    @Test
    public void testAnInputThatYieldsTwoReversedActions() {
        assertEquals(
                asList(Signal.DOUBLE_BLINK, Signal.WINK),
                new HandshakeCalculator().calculateHandshake(19));
    }

    @Ignore
    @Test
    public void testReversingASingleActionYieldsTheSameAction() {
        assertEquals(
                singletonList(Signal.JUMP),
                new HandshakeCalculator().calculateHandshake(24));
    }

    @Ignore
    @Test
    public void testReversingNoActionsYieldsNoActions() {
        assertEquals(
                emptyList(),
                new HandshakeCalculator().calculateHandshake(16));
    }

    @Ignore
    @Test
    public void testInputThatYieldsAllActions() {
        assertEquals(
                asList(Signal.WINK, Signal.DOUBLE_BLINK, Signal.CLOSE_YOUR_EYES, Signal.JUMP),
                new HandshakeCalculator().calculateHandshake(15));
    }

    @Ignore
    @Test
    public void testInputThatYieldsAllActionsReversed() {
        assertEquals(
                asList(Signal.JUMP, Signal.CLOSE_YOUR_EYES, Signal.DOUBLE_BLINK, Signal.WINK),
                new HandshakeCalculator().calculateHandshake(31));
    }

    @Ignore
    @Test
    public void testThatInput0YieldsNoActions() {
        assertEquals(
                emptyList(),
                new HandshakeCalculator().calculateHandshake(0));
    }

    @Ignore
    @Test
    public void testThatInputWithLower5BitsNotSetYieldsNoActions() {
        assertEquals(
                emptyList(),
                new HandshakeCalculator().calculateHandshake(32));
    }

}

@@ -18,16 +18,41 @@
 Ignore;%0A
+import org.junit.Before;%0A
 import o
@@ -66,16 +66,16 @@
 t.Test;%0A
-
 %0Aimport 
@@ -295,17 +295,185 @@
 rTest %7B%0A
+    private HandshakeCalculator handshakeCalculator;%0A    %0A    %0A    @Before%0A    public void setUp() %7B%0A        handshakeCalculator = new HandshakeCalculator();%0A    %7D%0A    
 %0A
-
     @Tes
@@ -594,37 +594,33 @@
                 
-new H
+h
 andshakeCalculat
@@ -613,34 +613,32 @@
 dshakeCalculator
-()
 .calculateHandsh
@@ -810,37 +810,33 @@
                 
-new H
+h
 andshakeCalculat
@@ -829,34 +829,32 @@
 dshakeCalculator
-()
 .calculateHandsh
@@ -1031,37 +1031,33 @@
                 
-new H
+h
 andshakeCalculat
@@ -1050,34 +1050,32 @@
 dshakeCalculator
-()
 .calculateHandsh
@@ -1231,38 +1231,33 @@
 %0A               
- new H
+h
 andshakeCalculat
@@ -1250,34 +1250,32 @@
 dshakeCalculator
-()
 .calculateHandsh
@@ -1452,37 +1452,33 @@
                 
-new H
+h
 andshakeCalculat
@@ -1471,34 +1471,32 @@
 dshakeCalculator
-()
 .calculateHandsh
@@ -1680,38 +1680,33 @@
 %0A               
- new H
+h
 andshakeCalculat
@@ -1699,34 +1699,32 @@
 dshakeCalculator
-()
 .calculateHandsh
@@ -1902,37 +1902,33 @@
                 
-new H
+h
 andshakeCalculat
@@ -1921,34 +1921,32 @@
 dshakeCalculator
-()
 .calculateHandsh
@@ -2101,37 +2101,33 @@
                 
-new H
+h
 andshakeCalculat
@@ -2120,34 +2120,32 @@
 dshakeCalculator
-()
 .calculateHandsh
@@ -2358,37 +2358,33 @@
                 
-new H
+h
 andshakeCalculat
@@ -2377,34 +2377,32 @@
 dshakeCalculator
-()
 .calculateHandsh
@@ -2623,37 +2623,33 @@
                 
-new H
+h
 andshakeCalculat
@@ -2642,34 +2642,32 @@
 dshakeCalculator
-()
 .calculateHandsh
@@ -2814,37 +2814,33 @@
                 
-new H
+h
 andshakeCalculat
@@ -2833,34 +2833,32 @@
 dshakeCalculator
-()
 .calculateHandsh
@@ -3031,21 +3031,17 @@
         
-new H
+h
 andshake
@@ -3050,18 +3050,16 @@
 lculator
-()
 .calcula

Fix for issue #354: extract common setup