@SuppressWarnings("serial")
@Test
public void testOnVehicleExit() {
VehicleExitEvent event = mock(VehicleExitEvent.class);
Boat boat = mock(Boat.class);
Server server = mock(Server.class);
when(server.getName()).thenReturn("Mock");
when(server.getVersion()).thenReturn("MockVer");
when(server.getBukkitVersion()).thenReturn("MockVer");
when(server.getLogger()).thenReturn(Logger.getLogger(Logger.GLOBAL_LOGGER_NAME));
when(server.getScheduler()).thenReturn(mock(BukkitScheduler.class));
Bukkit.setServer(server);
Location location = mock(Location.class);
World world = mock(World.class);
when(location.getWorld()).thenReturn(world);
when(boat.getLocation()).thenReturn(location);
when(boat.isValid()).thenReturn(true);
when(event.getVehicle()).thenReturn(boat);
ExitRemover rem = new ExitRemover();
rem.onVehicleExit(event);
verify(server).getScheduler();
CraftBookPlugin plugin = mock(CraftBookPlugin.class);
BukkitConfiguration config = mock(BukkitConfiguration.class);
when(plugin.getConfiguration()).thenReturn(config);
rem.giveItem = true;
CraftBookPlugin.setInstance(plugin);
rem.new BoatRemover(null, boat).run();
LivingEntity player = mock(LivingEntity.class);
when(player.getLocation()).thenReturn(location);
when(event.getExited()).thenReturn(player);
rem.new BoatRemover(player, boat).run();
player = mock(Player.class);
when(player.getLocation()).thenReturn(location);
when(event.getExited()).thenReturn(player);
Inventory inv = mock(PlayerInventory.class);
when(inv.addItem(Mockito.<ItemStack[]>any())).thenReturn(new HashMap<Integer, ItemStack>(){{put(0,null);}});