public static int count ( boolean [ ] array ) {
  int ans = 0 ;
  for ( int i = 0 ;
  i < array . length ;
  i ++ ) if ( array [ i ] ) ans ++ ;
  return ans ;
}

public static int count ( boolean [ ] array ) { int ans = 0 ; for ( int i = 0 ; i < array . length ; i ++ ) if ( array [ i ] ) ans ++ ; return ans ; }
(method_declaration (modifiers) type: (integral_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (array_type element: (boolean_type) dimensions: (dimensions)) name: (identifier))) body: (block (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (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: (field_access object: (identifier) field: (identifier))) update: (update_expression (identifier)) body: (if_statement condition: (parenthesized_expression (array_access array: (identifier) index: (identifier))) consequence: (expression_statement (update_expression (identifier))))) (return_statement (identifier))))