static long findSuperLucky ( long n , int f , int s , long formed ) {
  if ( formed >= n && f == s ) {
    return formed ;
  }
  if ( formed > n * 100 ) {
    return Long . MAX_VALUE ;
  }
  return Math . min ( findSuperLucky ( n , f + 1 , s , formed * 10 + 4 ) , findSuperLucky ( n , f , s + 1 , formed * 10 + 7 ) ) ;
}

static long findSuperLucky ( long n , int f , int s , long formed ) { if ( formed >= n && f == s ) { return formed ; } if ( formed > n * 100 ) { return Long . MAX_VALUE ; } return Math . min ( findSuperLucky ( n , f + 1 , s , formed * 10 + 4 ) , findSuperLucky ( n , f , s + 1 , formed * 10 + 7 ) ) ; }
(method_declaration (modifiers) type: (integral_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (integral_type) name: (identifier)) (formal_parameter type: (integral_type) name: (identifier)) (formal_parameter type: (integral_type) 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: (identifier) right: (identifier)))) consequence: (block (return_statement (identifier)))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (binary_expression left: (identifier) right: (decimal_integer_literal)))) consequence: (block (return_statement (field_access object: (identifier) field: (identifier))))) (return_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (method_invocation name: (identifier) arguments: (argument_list (identifier) (binary_expression left: (identifier) right: (decimal_integer_literal)) (identifier) (binary_expression left: (binary_expression left: (identifier) right: (decimal_integer_literal)) right: (decimal_integer_literal)))) (method_invocation name: (identifier) arguments: (argument_list (identifier) (identifier) (binary_expression left: (identifier) right: (decimal_integer_literal)) (binary_expression left: (binary_expression left: (identifier) right: (decimal_integer_literal)) right: (decimal_integer_literal)))))))))