static void f ( BigInteger start , int c ) {
  if ( c == C || visited . size ( ) == K ) {
    positions . add ( start ) ;
  }
  else {
    BigInteger childSize = BigInteger . valueOf ( K ) . pow ( C - c - 1 ) ;
    for ( int i = 0 ;
    i < K ;
    i ++ ) {
      if ( ! visited . contains ( i ) ) {
        visited . add ( i ) ;
        f ( start . add ( childSize . multiply ( BigInteger . valueOf ( i ) ) ) , c + 1 ) ;
        if ( c > 0 ) break ;
      }
    }
  }
}

static void f ( BigInteger start , int c ) { if ( c == C || visited . size ( ) == K ) { positions . add ( start ) ; } else { BigInteger childSize = BigInteger . valueOf ( K ) . pow ( C - c - 1 ) ; for ( int i = 0 ; i < K ; i ++ ) { if ( ! visited . contains ( i ) ) { visited . add ( i ) ; f ( start . add ( childSize . multiply ( BigInteger . valueOf ( i ) ) ) , c + 1 ) ; if ( c > 0 ) break ; } } } }
(method_declaration (modifiers) type: (void_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (type_identifier) name: (identifier)) (formal_parameter type: (integral_type) name: (identifier))) body: (block (if_statement condition: (parenthesized_expression (binary_expression left: (binary_expression left: (identifier) right: (identifier)) right: (binary_expression left: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)) right: (identifier)))) consequence: (block (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier))))) alternative: (block (local_variable_declaration type: (type_identifier) declarator: (variable_declarator name: (identifier) value: (method_invocation object: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier))) name: (identifier) arguments: (argument_list (binary_expression left: (binary_expression left: (identifier) right: (identifier)) right: (decimal_integer_literal)))))) (for_statement init: (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) condition: (binary_expression left: (identifier) right: (identifier)) update: (update_expression (identifier)) body: (block (if_statement condition: (parenthesized_expression (unary_expression operand: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier))))) consequence: (block (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier)))) (expression_statement (method_invocation name: (identifier) arguments: (argument_list (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier))))))) (binary_expression left: (identifier) right: (decimal_integer_literal))))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (decimal_integer_literal))) consequence: (break_statement))))))))))