/** Handles train car removal */ public static void runR() { try { TrainCar temp = list.removeCursor(); System.out.println( "Car successully unlinked. The following load has been removed from the train:\n" + "Name Weight (t) Value ($) Dangerous" + "==================================================="); System.out.println( String.format( "%-14s%-15s%-12s%-9s", temp.getProductLoad().getName(), temp.getProductLoad().getWeight(), temp.getProductLoad().getValue(), temp.getProductLoad().getDangerous())); } catch (NullPointerException e) { System.out.println("Could not remove train car."); } }