{"action":"created","issue":{"url":"https://api.github.com/repos/MutabilityDetector/MutabilityDetector/issues/86","repository_url":"https://api.github.com/repos/MutabilityDetector/MutabilityDetector","labels_url":"https://api.github.com/repos/MutabilityDetector/MutabilityDetector/issues/86/labels{/name}","comments_url":"https://api.github.com/repos/MutabilityDetector/MutabilityDetector/issues/86/comments","events_url":"https://api.github.com/repos/MutabilityDetector/MutabilityDetector/issues/86/events","html_url":"https://github.com/MutabilityDetector/MutabilityDetector/issues/86","id":154905508,"number":86,"title":"Immutability test failing","user":{"login":"harikrishna553","id":4006916,"avatar_url":"https://avatars.githubusercontent.com/u/4006916?v=3","gravatar_id":"","url":"https://api.github.com/users/harikrishna553","html_url":"https://github.com/harikrishna553","followers_url":"https://api.github.com/users/harikrishna553/followers","following_url":"https://api.github.com/users/harikrishna553/following{/other_user}","gists_url":"https://api.github.com/users/harikrishna553/gists{/gist_id}","starred_url":"https://api.github.com/users/harikrishna553/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/harikrishna553/subscriptions","organizations_url":"https://api.github.com/users/harikrishna553/orgs","repos_url":"https://api.github.com/users/harikrishna553/repos","events_url":"https://api.github.com/users/harikrishna553/events{/privacy}","received_events_url":"https://api.github.com/users/harikrishna553/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2016-05-15T12:08:21Z","updated_at":"2016-05-15T15:03:34Z","closed_at":null,"body":"```\r\nimport java.util.ArrayList;\r\nimport java.util.List;\r\n\r\npublic final class Student {\r\n\tprivate final int id;\r\n\tprivate final String name;\r\n\tprivate final List<String> hobbies;\r\n\r\n\tStudent(int id, String name, List<String> hobbies) {\r\n\t\tthis.id = id;\r\n\t\tthis.name = name;\r\n\t\tthis.hobbies = hobbies;\r\n\t}\r\n\r\n\tpublic int getId() {\r\n\t\treturn id;\r\n\t}\r\n\r\n\tpublic String getName() {\r\n\t\treturn name;\r\n\t}\r\n\r\n\tpublic List<String> getHobbies() {\r\n\t\treturn new ArrayList<> (hobbies);\r\n\t}\r\n\r\n}\r\n\r\n```\r\nWhen I tried to test for immutability using \"assertImmutable(Student.class);\", I am getting following error.\r\n\r\nAttempt to wrap mutable collection using a non-whitelisted unmodifiable wrapper method. [Field: hobbies.....]"},"comment":{"url":"https://api.github.com/repos/MutabilityDetector/MutabilityDetector/issues/comments/219290889","html_url":"https://github.com/MutabilityDetector/MutabilityDetector/issues/86#issuecomment-219290889","issue_url":"https://api.github.com/repos/MutabilityDetector/MutabilityDetector/issues/86","id":219290889,"user":{"login":"harikrishna553","id":4006916,"avatar_url":"https://avatars.githubusercontent.com/u/4006916?v=3","gravatar_id":"","url":"https://api.github.com/users/harikrishna553","html_url":"https://github.com/harikrishna553","followers_url":"https://api.github.com/users/harikrishna553/followers","following_url":"https://api.github.com/users/harikrishna553/following{/other_user}","gists_url":"https://api.github.com/users/harikrishna553/gists{/gist_id}","starred_url":"https://api.github.com/users/harikrishna553/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/harikrishna553/subscriptions","organizations_url":"https://api.github.com/users/harikrishna553/orgs","repos_url":"https://api.github.com/users/harikrishna553/repos","events_url":"https://api.github.com/users/harikrishna553/events{/privacy}","received_events_url":"https://api.github.com/users/harikrishna553/received_events","type":"User","site_admin":false},"created_at":"2016-05-15T15:03:34Z","updated_at":"2016-05-15T15:03:34Z","body":"Got your point. What if my constructor is like below.\r\n\r\n```\r\nStudent(int id, String name, List<String> hobbies) {\r\n\t\tthis.id = id;\r\n\t\tthis.name = name;\r\n\t\tthis.hobbies = new ArrayList<> (hobbies);\r\n\t}\r\n\r\n```"}}