public static void main ( String [ ] args ) {
  char [ ] str = "4321" . toCharArray ( ) ;
  if ( prevPermutation ( str ) ) {
    System . out . println ( "Previous permutation is " + String . valueOf ( str ) ) ;
  }
  else {
    System . out . println ( "Previous permutation" + "doesn't exist" ) ;
  }
}

public static void main ( String [ ] args ) { char [ ] str = "4321" . toCharArray ( ) ; if ( prevPermutation ( str ) ) { System . out . println ( " Previous ▁ permutation ▁ is ▁ " + String . valueOf ( str ) ) ; } else { System . out . println ( " Previous ▁ permutation " + " doesn ' t ▁ exist " ) ; } }
(method_declaration (modifiers) type: (void_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (array_type element: (type_identifier) dimensions: (dimensions)) name: (identifier))) body: (block (local_variable_declaration type: (array_type element: (integral_type) dimensions: (dimensions)) declarator: (variable_declarator name: (identifier) value: (method_invocation object: (string_literal) name: (identifier) arguments: (argument_list)))) (if_statement condition: (parenthesized_expression (method_invocation name: (identifier) arguments: (argument_list (identifier)))) consequence: (block (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (binary_expression left: (string_literal) right: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier)))))))) alternative: (block (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (binary_expression left: (string_literal) right: (string_literal)))))))))