@Test(expected = NotFoundException.class) public void should_throw_exception_when_searching_inexistant_wall() throws NotFoundException { wallHolderService.find("not.exist"); }
@Override public Wall find(String wallName) throws NotFoundException { Preconditions.checkNotNull(wallName, "wallName"); Wall wall = WALLS.get(wallName); if (wall == null) { throw new NotFoundException("Wall with name : " + wallName + " not found"); } return wall; }
WallHolderService implements WallDAO { @Override public Wall find(String wallName) throws NotFoundException { Preconditions.checkNotNull(wallName, "wallName"); Wall wall = WALLS.get(wallName); if (wall == null) { throw new NotFoundException("Wall with name : " + wallName + " not found"); } return wall; } }
WallHolderService implements WallDAO { @Override public Wall find(String wallName) throws NotFoundException { Preconditions.checkNotNull(wallName, "wallName"); Wall wall = WALLS.get(wallName); if (wall == null) { throw new NotFoundException("Wall with name : " + wallName + " not found"); } return wall; }  }
WallHolderService implements WallDAO { @Override public Wall find(String wallName) throws NotFoundException { Preconditions.checkNotNull(wallName, "wallName"); Wall wall = WALLS.get(wallName); if (wall == null) { throw new NotFoundException("Wall with name : " + wallName + " not found"); } return wall; }  @Override List<Wall> getWalls(); @Override Wall find(String wallName); @Override Wall update(Wall wall); Set<String> getWallNames(); @Override void deleteWall(String wallName); }
WallHolderService implements WallDAO { @Override public Wall find(String wallName) throws NotFoundException { Preconditions.checkNotNull(wallName, "wallName"); Wall wall = WALLS.get(wallName); if (wall == null) { throw new NotFoundException("Wall with name : " + wallName + " not found"); } return wall; }  @Override List<Wall> getWalls(); @Override Wall find(String wallName); @Override Wall update(Wall wall); Set<String> getWallNames(); @Override void deleteWall(String wallName);  }