### Question:
Tileable implements Entity { public boolean isReleasable(Direction direction, Marble marble) { if (tile == null) { throw new IllegalStateException(TILEABLE_UNPLACED); } Tile neighbour = tile.get(direction); return neighbour != null && neighbour.getTileable().accepts(direction.inverse(), marble); }  abstract boolean allowsConnection(Direction direction); abstract boolean accepts(Direction direction, Marble marble); abstract void accept(Direction direction, Marble marble); boolean isConnected(Direction direction); boolean isReleasable(Direction direction, Marble marble); void release(Direction direction, Marble marble); Tile getTile(); void setTile(Tile tile); Set<TileableListener> getListeners(); boolean addListener(TileableListener listener); boolean removeListener(TileableListener listener); boolean onGrid();  }### Answer:
@Test public void isReleasable() { Tileable tileable = grid.get(0, 0).getTileable(); assertThat(tileable.isReleasable(Direction.RIGHT, marble)).isTrue(); }
@Test public void isNotReleasable() { Tileable tileable = grid.get(0, 0).getTileable(); assertThat(tileable.isReleasable(Direction.LEFT, marble)).isFalse(); }
@Test public void neighbourDoesNotAllowReleasing() { Tileable tileable = grid.get(0, 1).getTileable(); assertThat(tileable.isReleasable(Direction.RIGHT, marble)).isFalse(); }
@Test public void unplacedNotReleasable() { Track track = new HorizontalTrack(); assertThatThrownBy(() -> track.isReleasable(Direction.RIGHT, marble)) .isInstanceOf(IllegalStateException.class); }