Change instanceof equals() comparison to isAssignableFrom()