Java Sort and Search examples