@Test public void informDispose() { Direction direction = Direction.RIGHT; Marble marble = new Marble(MarbleType.BLUE); TileableListener listener = mock(TileableListener.class); teleporter1.addListener(listener); teleporter1.ballDisposed(teleporter1, direction, marble); verify(listener, times(1)).ballDisposed( teleporter1, direction, marble); }
@Override public void ballDisposed(Tileable tileable, Direction direction, Marble marble) { informDispose(direction, marble); }
Teleporter extends Tileable implements TileableListener { @Override public void ballDisposed(Tileable tileable, Direction direction, Marble marble) { informDispose(direction, marble); } }
Teleporter extends Tileable implements TileableListener { @Override public void ballDisposed(Tileable tileable, Direction direction, Marble marble) { informDispose(direction, marble); } Teleporter(Track track); }
Teleporter extends Tileable implements TileableListener { @Override public void ballDisposed(Tileable tileable, Direction direction, Marble marble) { informDispose(direction, marble); } Teleporter(Track track); void setDestination(Teleporter destination); Track getTrack(); Teleporter getDestination(); @Override boolean allowsConnection(Direction direction); @Override boolean accepts(Direction direction, Marble marble); @Override void accept(Direction direction, Marble marble); @Override void ballAccepted(Tileable tileable, Direction direction, Marble marble); @Override void ballDisposed(Tileable tileable, Direction direction, Marble marble); @Override void ballReleased(Tileable tileable, Direction direction, Marble marble); }
Teleporter extends Tileable implements TileableListener { @Override public void ballDisposed(Tileable tileable, Direction direction, Marble marble) { informDispose(direction, marble); } Teleporter(Track track); void setDestination(Teleporter destination); Track getTrack(); Teleporter getDestination(); @Override boolean allowsConnection(Direction direction); @Override boolean accepts(Direction direction, Marble marble); @Override void accept(Direction direction, Marble marble); @Override void ballAccepted(Tileable tileable, Direction direction, Marble marble); @Override void ballDisposed(Tileable tileable, Direction direction, Marble marble); @Override void ballReleased(Tileable tileable, Direction direction, Marble marble);  }