@Override
    public boolean equals(Object o) {
        if (o == null || (!o.getClass().equals(getClass()))) {
            return false;
        }
        ResultOrError other = (ResultOrError) o;
        return Objects.equals(error, other.error) &&
            Objects.equals(result, other.result);
    }
@Test
    public void testEquals() {
        ResultOrError<String> a = new ResultOrError<>(Errors.INVALID_REQUEST, "missing foobar");
        ResultOrError<String> b = new ResultOrError<>("abcd");
        assertNotEquals(a, b);
        assertNotEquals(b, a);
        assertEquals(a, a);
        assertEquals(b, b);
        ResultOrError<String> c = new ResultOrError<>(Errors.INVALID_REQUEST, "missing baz");
        assertNotEquals(a, c);
        assertNotEquals(c, a);
        assertEquals(c, c);
    }