<awangdev>Combinations_1.java
private void dfs(List<List<Integer>> result, List<Integer> list, int index, int k, int n) {

        for (int i = index; i <= n; i++) {
            list.add(i);
            if (list.size() == k) {
                result.add(new ArrayList<>(list));
                list.remove(list.size() - 1);
                continue;
            }

            dfs(result, list, i + 1, k, n);
            list.remove(list.size() - 1);
        }
    }
private void sample_funcname ( List < List < Integer >> result , List < Integer > list , int index , int k , int n ) {
  for ( int i = index ;
  i <= n ;
  i ++ ) {
    list . add ( i ) ;
    if ( list . size ( ) == k ) {
      result . add ( new ArrayList < > ( list ) ) ;
      list . remove ( list . size ( ) - 1 ) ;
      continue ;
    }
    dfs ( result , list , i + 1 , k , n ) ;
    list . remove ( list . size ( ) - 1 ) ;
  }
}
