There is need to compare two objects based on class they implement? When to compare using getClass() and when getClass().getName()? Is there any differ
getClass()
getClass().getName()
You can use the inbuilt method of Class :
if(nextMonster.getClass().isAssignableFrom(monster.getClass()))