public static int countIdenticalRows ( int mat [ ] [ ] ) {
  int count = 0 ;
  for ( int i = 0 ;
  i < mat . length ;
  i ++ ) {
    int first = mat [ i ] [ 0 ] ;
    boolean allSame = true ;
    for ( int j = 1 ;
    j < mat [ i ] . length ;
    j ++ ) {
      if ( mat [ i ] [ j ] != first ) {
        allSame = false ;
        break ;
      }
    }
    if ( allSame ) count ++ ;
  }
  return count ;
}

public static int countIdenticalRows ( int mat [ ] [ ] ) { int count = 0 ; for ( int i = 0 ; i < mat . length ; i ++ ) { int first = mat [ i ] [ 0 ] ; boolean allSame = true ; for ( int j = 1 ; j < mat [ i ] . length ; j ++ ) { if ( mat [ i ] [ j ] != first ) { allSame = false ; break ; } } if ( allSame ) count ++ ; } return count ; }
(method_declaration (modifiers) type: (integral_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (integral_type) name: (identifier) dimensions: (dimensions))) 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: (block (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (array_access array: (array_access array: (identifier) index: (identifier)) index: (decimal_integer_literal)))) (local_variable_declaration type: (boolean_type) declarator: (variable_declarator name: (identifier) value: (true))) (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: (array_access array: (identifier) index: (identifier)) field: (identifier))) update: (update_expression (identifier)) body: (block (if_statement condition: (parenthesized_expression (binary_expression left: (array_access array: (array_access array: (identifier) index: (identifier)) index: (identifier)) right: (identifier))) consequence: (block (expression_statement (assignment_expression left: (identifier) right: (false))) (break_statement))))) (if_statement condition: (parenthesized_expression (identifier)) consequence: (expression_statement (update_expression (identifier)))))) (return_statement (identifier))))