### Question:
Board { public Cell[] checkWay(Cell source, Cell dest) throws FigureNotFoundException, ImpossibleMoveException { Cell[] figureWay = {new Cell(-1, -1)}; if (source != null && dest != null) { boolean doneFigureFound = false; for (Figure checkedFigure : figures) { if (checkedFigure != null && checkedFigure.position != null && checkedFigure.position.equals(source)) { figureWay = checkedFigure.way(source, dest); doneFigureFound = true; break; } } if (!doneFigureFound) { throw new FigureNotFoundException(String.format( "%s: %s | %s %s", "В ячейке", source.getX(), source.getY(), "нет фигуры.") ); } } return figureWay; }  void add(Figure figure); Figure[] getFigures(); Cell[] checkWay(Cell source, Cell dest); boolean checkFigureWay(Cell[] way);  }### Answer:
@Test public void checkWayIfFigureNotFoundInFiguresThenThrowException() throws ImpossibleMoveException { Board testBoard = new Board(); try { testBoard.checkWay(new Cell(4, 4), new Cell(2, 2)); } catch (FigureNotFoundException fnfe) { assertThat(fnfe.getMessage(), is("В ячейке: 4 | 4 нет фигуры.")); } }