public String getStageName() {
        if(isBuilding()) {
            try {
                return buildLocator.split("/")[2];
            } catch (ArrayIndexOutOfBoundsException e) {
                return null;
            }
        }
        return null;
    }
@Test
    public void shouldReturnTheStageName() {
        AgentBuildingInfo agentBuildingInfo = new AgentBuildingInfo("buildInfo", "foo/1/bar");
        assertThat(agentBuildingInfo.getStageName(), is("bar"));
    }