{"action":"opened","issue":{"url":"https://api.github.com/repos/phenotips/phenotips/issues/1656","labels_url":"https://api.github.com/repos/phenotips/phenotips/issues/1656/labels{/name}","comments_url":"https://api.github.com/repos/phenotips/phenotips/issues/1656/comments","events_url":"https://api.github.com/repos/phenotips/phenotips/issues/1656/events","html_url":"https://github.com/phenotips/phenotips/issues/1656","id":74486960,"number":1656,"title":"Cannot mock singleton class","user":{"login":"JKereliuk","id":9435736,"avatar_url":"https://avatars.githubusercontent.com/u/9435736?v=3","gravatar_id":"","url":"https://api.github.com/users/JKereliuk","html_url":"https://github.com/JKereliuk","followers_url":"https://api.github.com/users/JKereliuk/followers","following_url":"https://api.github.com/users/JKereliuk/following{/other_user}","gists_url":"https://api.github.com/users/JKereliuk/gists{/gist_id}","starred_url":"https://api.github.com/users/JKereliuk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JKereliuk/subscriptions","organizations_url":"https://api.github.com/users/JKereliuk/orgs","repos_url":"https://api.github.com/users/JKereliuk/repos","events_url":"https://api.github.com/users/JKereliuk/events{/privacy}","received_events_url":"https://api.github.com/users/JKereliuk/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-05-08T20:35:02Z","updated_at":"2015-05-08T20:35:02Z","closed_at":null,"body":"In AnnotationTerm.java, \r\n```\r\nphenotips/components/phenotype-mapping-service/src/main/java/org/phenotips/hpoa/annotation/AnnotationTerm.java\r\n```\r\nWe have\r\n```\r\n    @Override\r\n    public String toString()\r\n    {\r\n        Ontology hpo = HPO.getInstance();\r\n        StringBuilder str = new StringBuilder();\r\n        str.append(this.id).append(' ').append(this.name).append('\\n');\r\n        for (String nodeId : this.getNeighbors()) {\r\n            str.append(\"            \").append(nodeId).append('\\t').append(hpo.getName(nodeId)).append('\\n');\r\n        }\r\n        return str.toString();\r\n    }\r\n```\r\n\r\nHere HPO is not being injected and I cannot find a way, (at the moment), to mock it for testing. Is there any work around for this? Is it worth it?"}}