package shouty;

import cucumber.api.java.en.Given;
import cucumber.api.java.en.Then;
import cucumber.api.java.en.When;
import org.junit.Assert;


public class ShoutSteps {
    private static final String ARBITRARY_MESSAGE = "Hello, world";
    private final Shouty shouty = new Shouty();

    @Given("^Lucy is at \\[(\\d+), (\\d+)\\]$")
    public void lucy_is_at(int xCoord, int yCoord) throws Throwable {
        shouty.setLocation("Lucy", new Coordinate(xCoord, yCoord));
    }

    @Given("^Sean is at \\[(\\d+), (\\d+)\\]$")
    public void sean_is_at(int xCoord, int yCoord) throws Throwable {
        shouty.setLocation("Sean", new Coordinate(xCoord, yCoord));
    }

    @When("^Sean shouts$")
    public void sean_shouts() throws Throwable {
        shouty.shout("Sean", ARBITRARY_MESSAGE);
    }

    @Then("^Lucy should hear Sean")
    public void lucy_should_hear_sean() throws Throwable {
        Assert.assertEquals(1, shouty.getMessagesHeardBy("Lucy").size());
    }

    @Then("^Lucy should hear nothing$")
    public void lucy_should_hear_nothing() throws Throwable {
        Assert.assertEquals(0, shouty.getMessagesHeardBy("Lucy").size());
    }
}

@@ -113,23 +113,78 @@
 n.When;%0A
+%0A
 import 
+static java.util.Collections.emptyList;%0Aimport static 
 org.juni
@@ -191,16 +191,29 @@
 t.Assert
+.assertEquals
 ;%0A%0A%0Apubl
@@ -964,39 +964,32 @@
 wable %7B%0A        
-Assert.
 assertEquals(1, 
@@ -1148,23 +1148,16 @@
         
-Assert.
 assertEq
@@ -1165,9 +1165,19 @@
 als(
-0
+emptyList()
 , sh
@@ -1199,34 +1199,27 @@
 sHeardBy(%22Lucy%22)
-.size()
 );%0A    %7D%0A%7D%0A

Improve assertions