I would like to compare the string time format
Don't, unless you really have to.
In general - and this is something that has become clearer to me over time, watching many Stack Overflow questions - the sooner you can get your data into a "natural" format, the better. In this case, the natural data format is something representing a time of day, not a string.
So parse all your strings - ideally using Joda Time and its DateTimeFormatter.parseLocalTime
method to create LocalTime
objects. Then they will be naturally comparable, and also usable for anything else you want to do. Keep the data in its natural form for as long as you can, only converting it to a string or other representation when you absolutely have to, e.g. for serialization to another machine.
Of course, if you can avoid having a string representation at all that would be even better.