private static int getChainLength ( int n ) {
  Set < Integer > seen = new HashSet < > ( ) ;
  while ( true ) {
    if ( ! seen . add ( n ) ) return seen . size ( ) ;
    n = factorialize ( n ) ;
  }
}

private static int getChainLength ( int n ) { Set < Integer > seen = new HashSet < > ( ) ; while ( true ) { if ( ! seen . add ( n ) ) return seen . size ( ) ; n = factorialize ( n ) ; } }
(method_declaration (modifiers) type: (integral_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (integral_type) name: (identifier))) body: (block (local_variable_declaration type: (generic_type (type_identifier) (type_arguments (type_identifier))) declarator: (variable_declarator name: (identifier) value: (object_creation_expression type: (generic_type (type_identifier) (type_arguments)) arguments: (argument_list)))) (while_statement condition: (parenthesized_expression (true)) body: (block (if_statement condition: (parenthesized_expression (unary_expression operand: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier))))) consequence: (return_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)))) (expression_statement (assignment_expression left: (identifier) right: (method_invocation name: (identifier) arguments: (argument_list (identifier)))))))))