I get a NullPointerException while running my webapplication, I save a logs and start server again and this error no longer there appeared, but i want protect method to NullPointer never appeared. I sure this line is responsible for this error
Vehicle pVehicle =
Iterables.tryFind(aFactory.getVehicle(), new Predicate<Vehicle>() {
@Override
public boolean apply(Vehicle vehicle) {
return vehicle.getVehicleBrand().equals(aVehicle.getVehicleBrand());
}
}).orNull();
But this is not my code, and i don't known, which part may cause this error> Please, which element can be appeared for this NullPointer and how protect this code