public ApiError error() {
        return error;
    }
@Test
    public void testError() {
        ResultOrError<Integer> resultOrError =
            new ResultOrError<>(Errors.INVALID_REQUEST, "missing foobar");
        assertTrue(resultOrError.isError());
        assertFalse(resultOrError.isResult());
        assertNull(resultOrError.result());
        assertEquals(new ApiError(Errors.INVALID_REQUEST, "missing foobar"),
            resultOrError.error());
    }