boolean wasRemoved = plan.getCompanions().remove(prospect);
if (!wasRemoved) {
return Response.status(Response.Status.BAD_REQUEST).entity("There was no prospect with id " + prospectId +" as a companion on the trip.").build();
}
Even if the first line resulted in an item being removed, the "wasRemoved" var is always false.