@Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        CarState state = (CarState) o;

        if (primaryKey != null) return primaryKey.equals(state.primaryKey);

        if (lengthInCentimeters != state.lengthInCentimeters) return false;
        if (color != state.color) return false;
        if (name != null ? !name.equals(state.name) : state.name != null) return false;

        return true;
    }