title: TreeMap what wrong with "ё"?
body: <p>task: try to calculate amount of letters in words from console;</p>
  
  <p>problem: with letter "ё";</p>
  
  <pre><code> public static void main(String[] args) throws Exception{
      BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
  
      String abc = "абвгдеёжзийклмнопрстуфхцчшщъыьэюя"; //alphabet
      //String abc = "абвгдежзийклмнопрстуфхцчшщъыьэюя"; // without "ё";
      //String abc = "abcdefghijklmnopqrstuvwxyz";// eng
  
      char[] abcArray = abc.toCharArray();
  
      ArrayList&lt;Character&gt; alphabet = new ArrayList&lt;Character&gt;();
      for (int i = 0; i &lt; abcArray.length; i++)
      {
          alphabet.add(abcArray[i]);
      }
  
      //read console
      ArrayList&lt;String&gt; list = new ArrayList&lt;String&gt;();
      for (int i = 0; i &lt; 10; i++)
      {
          String s = reader.readLine();
          if (s.isEmpty()) break;
          list.add(s.toLowerCase());
      }
  
      Map&lt;Character, Integer&gt; result = new TreeMap&lt;Character, Integer&gt;();
  
      for (Character x : alphabet){
          int count = 0;
          for (String y : list){
              char[] data = y.toCharArray();
              for (int i = 0; i &lt; data.length; i++) {
                  if (x.equals(data[i])){
                      count++;
                  }
              }
              result.put(x,count);
          }
      }
      for (Map.Entry&lt;Character, Integer&gt; p : result.entrySet()){
          System.out.println(p.getKey() + " " + p.getValue());
      }
  }
  </code></pre>
  
  <p>output code </p>
  
  <pre>
      абвгдеёжзийклмнопрстуфхцчшщъыьэюя
  а 1
  б 1
  в 1
  г 1
  д 1
  е 1
  ж 1
  з 1
  и 1
  й 1
  к 1
  л 1
  м 1
  н 1
  о 1
  п 1
  р 1
  с 1
  т 1
  у 1
  ф 1
  х 1
  ц 1
  ч 1
  ш 1
  щ 1
  ъ 1
  ы 1
  ь 1
  э 1
  ю 1
  я 1
  ё 1
  </pre>
  
  <p>letter "ё" on bottom of list, but it should be between "e" and "ж"</p>
  
  <p><a href="http://i.stack.imgur.com/ZCxqj.png" rel="nofollow">in debug mode - in cycle letter "ё" came after "e" and put in map after "e". But when we work with next one letter "ж" letter "ё" move to the bottom of list, and "ж" placed after "e".</a></p>
  
  <p>If use alphabet without "ё" or english alphabet - all letters keep their position. 
  My question is: why it happened? I do something wrong? I necessarily should used map.</p>