{"action":"created","issue":{"url":"https://api.github.com/repos/jxw1102/Projet-merou/issues/3","labels_url":"https://api.github.com/repos/jxw1102/Projet-merou/issues/3/labels{/name}","comments_url":"https://api.github.com/repos/jxw1102/Projet-merou/issues/3/comments","events_url":"https://api.github.com/repos/jxw1102/Projet-merou/issues/3/events","html_url":"https://github.com/jxw1102/Projet-merou/issues/3","id":56920844,"number":3,"title":"How scala Set distinguish two different objects?","user":{"login":"jxw1102","id":1309108,"avatar_url":"https://avatars.githubusercontent.com/u/1309108?v=3","gravatar_id":"","url":"https://api.github.com/users/jxw1102","html_url":"https://github.com/jxw1102","followers_url":"https://api.github.com/users/jxw1102/followers","following_url":"https://api.github.com/users/jxw1102/following{/other_user}","gists_url":"https://api.github.com/users/jxw1102/gists{/gist_id}","starred_url":"https://api.github.com/users/jxw1102/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jxw1102/subscriptions","organizations_url":"https://api.github.com/users/jxw1102/orgs","repos_url":"https://api.github.com/users/jxw1102/repos","events_url":"https://api.github.com/users/jxw1102/events{/privacy}","received_events_url":"https://api.github.com/users/jxw1102/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/jxw1102/Projet-merou/labels/help%20wanted","name":"help wanted","color":"159818"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-02-07T18:37:00Z","updated_at":"2015-02-07T19:14:42Z","closed_at":null,"body":"In my code, each CaseStmt will be connected to the CompoundStmt(accolade) of SwitchStmt. If i use **scala.collection.mutable.Set** as the type of **_prev** and **_next**, \r\n```private val _next = MSet[SourceCodeNode]()```\r\n```private val _prev = MSet[SourceCodeNode]()```\r\nthere is one CaseStmt that is not connected to CompoundStmt; *CompoundStmt.next = List(DefaultStmt_102871548, CaseStmt_102871358)*\r\n\r\n![set](https://cloud.githubusercontent.com/assets/1309108/6093238/6c69f0dc-aefe-11e4-82f6-9175325ce929.png)\r\n\r\nif i use **scala.collection.mutable.ArrayBuffer** as the type of  **_prev** and **_next**, \r\n```private val _next = ArrayBuffer[SourceCodeNode]()```\r\n```private val _prev = ArrayBuffer[SourceCodeNode]()```\r\ni can get the expected result.     *CompoundStmt.next = List(CaseStmt_102871358, CaseStmt_102871420, DefaultStmt_102871548)*\r\n\r\n![array](https://cloud.githubusercontent.com/assets/1309108/6093239/6eaf1980-aefe-11e4-9ce3-69b86463f667.png)"},"comment":{"url":"https://api.github.com/repos/jxw1102/Projet-merou/issues/comments/73378297","html_url":"https://github.com/jxw1102/Projet-merou/issues/3#issuecomment-73378297","issue_url":"https://api.github.com/repos/jxw1102/Projet-merou/issues/3","id":73378297,"user":{"login":"jxw1102","id":1309108,"avatar_url":"https://avatars.githubusercontent.com/u/1309108?v=3","gravatar_id":"","url":"https://api.github.com/users/jxw1102","html_url":"https://github.com/jxw1102","followers_url":"https://api.github.com/users/jxw1102/followers","following_url":"https://api.github.com/users/jxw1102/following{/other_user}","gists_url":"https://api.github.com/users/jxw1102/gists{/gist_id}","starred_url":"https://api.github.com/users/jxw1102/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jxw1102/subscriptions","organizations_url":"https://api.github.com/users/jxw1102/orgs","repos_url":"https://api.github.com/users/jxw1102/repos","events_url":"https://api.github.com/users/jxw1102/events{/privacy}","received_events_url":"https://api.github.com/users/jxw1102/received_events","type":"User","site_admin":false},"created_at":"2015-02-07T19:14:42Z","updated_at":"2015-02-07T19:14:42Z","body":"Yes, it's more reasonable to use Set. I overrided ```equals``` and ```hashCode``` like this. Now the Set works!\r\n![screen shot 2015-02-07 at 20 12 00](https://cloud.githubusercontent.com/assets/1309108/6093590/afc452c6-af05-11e4-9c8a-42a548901062.png)"}}