Java Sort Object Array Javascript Length Text