Enhancements for Permissions/CacheView/ErrorResponseException (#633) * Improved equals checks, removed duplicate code * Made iterators use copied arrays * Store final empty array for optimization * Micro optimizations for permissions because why not * Use obj.toString() in ErrorResponseException when json is present * Removed annoying warnings about deprecation and unchecked casts (commit: 52bf802)