### Question:
Receptor extends Tileable { @Override public void accept(Direction direction, Marble marble) { getSlot(direction).accept(marble); }  void rotate(int turns); int getRotation(); Slot getSlot(Direction direction); boolean isMarked(); boolean isLocked(); void lock(); void unlock(); PowerUp getPowerUp(); void setPowerUp(PowerUp powerUp); @Override boolean isReleasable(Direction direction, Marble marble); @Override boolean allowsConnection(Direction direction); @Override boolean accepts(Direction direction, Marble marble); @Override void accept(Direction direction, Marble marble);  }### Answer:
@Test public void acceptWhenSlotOccupied() { receptor.accept(Direction.TOP, new Marble(MarbleType.BLUE)); assertThatThrownBy(() -> receptor.accept(Direction.TOP, new Marble(MarbleType.BLUE))) .isInstanceOf(IllegalStateException.class) .hasMessage("The slot is already occupied"); }
@Test public void notMark() { ReceptorListener listener = mock(ReceptorListener.class); ReceptorListener stub = new ReceptorListener() {}; TileableListener tileableListener = mock(TileableListener.class); receptor.addListener(listener); receptor.addListener(stub); receptor.addListener(tileableListener); Progress progress = mock(Progress.class); GameSession session = mock(GameSession.class); when(session.getProgress()).thenReturn(progress); Grid grid = new Grid(session, 2, 1); grid.place(0, 0, receptor); receptor.accept(Direction.TOP, new Marble(MarbleType.GREEN)); receptor.accept(Direction.RIGHT, new Marble(MarbleType.JOKER)); receptor.accept(Direction.BOTTOM, new Marble(MarbleType.BLUE)); receptor.accept(Direction.LEFT, new Marble(MarbleType.BLUE)); verify(listener, never()).receptorMarked(receptor); verify(progress, never()).score(anyInt()); }