Identify if a passenger can get on train - Java Quiz Question


Given the train journey details, write a program to identify if the given person can get on the train. Assume that the train journey is always in a single day.

Input (List, String, String) Output (boolean)
[[Chennai-null-15:00-0], [Gudur-17:00-17:10-100], [Nellore-18:30-19:00-25], [Kavali-20:00-20:05-20], [Ongole-21:30-21:40-40], [Chirala -22:30-22:35-31], [Tenali Junction-23:00-23:01-31]], 'Chennai', '14:15' true
[[Hyderabad-null-08:00-0], [Bhongir-08:59-09:00-47], [Aler-09:19-09:20-70], [Jangaon-09:29-09:30-84], [Ghanpur-09:53-09:54-112], [Kazipet Jn-10:28-10:30-132], [Jamikunta-10:58-10:59-168], [Odela-11:24-11:25-188], [Peddapalli-11:34-11:35-208], [Ramgundam-11:42-11:43-225], [Mancheral-11:55-11:56-239], [Belampalli-12:21-12:22-258], [Sirpur Kagazngr-13:45-null-297]], 'Peddapalli', '11:40' false
[[Nellore-null--02:30-0], [Ongole-04:30-04:35-100], [Guntur-09:30-09:32-100], [Vijayawada-12:10-12:30-100],[Kakinada-17:20-17:25-15],[Rajahmundry-23:00-null-100]], 'Kakinada', '17:01' true


import java.util.*;
class CanPassengerGetOnTrain
{
    public static void main(String s[])
    {
        ArrayList<Destination> journey = new ArrayList<Destination>();
        journey.add(new Destination("Chennai", null, "15:00", 0));
        journey.add(new Destination("Gudur", "17:00", "17:10", 100));
        journey.add(new Destination("Nellore", "18:30", "19:00", 25));
        journey.add(new Destination("Kavali", "20:00", "20:05", 20));
        journey.add(new Destination("Ongole", "21:30", "21:40", 40));
        journey.add(new Destination("Chirala", "22:30", "22:35", 31));
        journey.add(new Destination("Tenali Junction", "23:00", null, 31));
        System.out.println("The passenger who reaches Kavali station by 19:50 can get on train : " + canGetOnTrain(journey, "Kavali", "19:50"));

    }


    private static boolean canGetOnTrain(ArrayList<Destination> journey, String station, String arrivalTime) {
    }
    

}
class Destination {

String cityName;
String arrivalTime;
String depatureTime;
int kiloMeters;

public Destination(String cityName, String arrivalTime, String depatureTime, int kiloMeters) {
this.cityName = cityName;
this.arrivalTime = arrivalTime;
this.depatureTime = depatureTime;
this.kiloMeters = kiloMeters;
}

@Override
public String toString() {
return "[" + cityName + "-" + arrivalTime + "-" + depatureTime + "-" + kiloMeters + "]";
}
}