You can either test the first of the list
if (!vehiclelist.isEmpty()) {
if (vehiclelist.get(0).getMendixObject().getType().equals(Car.getType())) {
}
}
or all
vehiclelist.forEach(vehicle -> {
if (Vehicle.getType().equals(Car.getType())) {
}
}
);
it is recommend to use the proxy instead of "Car" or "MyModule.Car"