@Test void vehicleData() { String name = "vehicle name"; int capacity = 1000; VehicleData vehicleData = VehicleFactory.vehicleData(name, capacity); assertThat(vehicleData.name()).isEqualTo(name); assertThat(vehicleData.capacity()).isEqualTo(capacity); }
public static VehicleData vehicleData(String name, int capacity) { return new VehicleData(name, capacity); }
VehicleFactory { public static VehicleData vehicleData(String name, int capacity) { return new VehicleData(name, capacity); } }
VehicleFactory { public static VehicleData vehicleData(String name, int capacity) { return new VehicleData(name, capacity); } private  VehicleFactory(); }
VehicleFactory { public static VehicleData vehicleData(String name, int capacity) { return new VehicleData(name, capacity); } private  VehicleFactory(); static VehicleData vehicleData(String name, int capacity); static Vehicle createVehicle(long id, String name, int capacity); static Vehicle testVehicle(long id); }
VehicleFactory { public static VehicleData vehicleData(String name, int capacity) { return new VehicleData(name, capacity); } private  VehicleFactory(); static VehicleData vehicleData(String name, int capacity); static Vehicle createVehicle(long id, String name, int capacity); static Vehicle testVehicle(long id);  }