あきれたソース

Hoge[] hoges = hogeService.getAllHoge();
TreeMap<String, Hoge> tmap = new TreeMap<String, Hoge>();
for (Hoge hoge : hoges) {
    tmap.put(hoge.getValue(), hoge);
}
int i = 0;
for (Iterator<Entry<String, Hoge>> ite = tmap.entrySet().iterator(); ite.hasNext();) {
    hoges[i] = ite.next().getValue();
    i++;
}

どうやらソートがしたいらしい。
みているだけで気持ちが悪い。