[JAVA] Simple java solution without any for/while loop.
Code\n\nclass Solution {\n    static void subsequence(int i,int[] arr, List<Integer> lst, List<List<Integer>> res){\n        if(res.contains(lst)) return;\n    
# Code\n```\nclass Solution {\n    static void subsequence(int i,int[] arr, List<Integer> lst, List<List<Integer>> res){\n        if(res.contains(lst)) return;\n        if(i==arr.length){\n            res.add(new ArrayList<>(lst));\n            return;\n        }\n        lst.add(arr[i]);\n        subsequence(i+1, arr, lst, res);\n        lst.remove(lst.size()-1);\n        subsequence(i+1, arr, lst, res);\n    }\n\n    public List<List<Integer>> subsetsWithDup(int[] nums) {\n        Arrays.sort(nums);\n        List<List<Integer>> res=new ArrayList<>();\n        subsequence(0, nums, new ArrayList<>(), res);\n        return res;\n    }\n}\n```
['Array', 'Backtracking', 'Recursion', 'Sorting', 'Java']