class VolleyX {

    public static <T> Observable<T> from(final Request<T> request) {
        if (!sInited) throw new IllegalStateException("call init first");
        if (request == null) throw new NullPointerException("request can not be null");
        return Observable.defer(new Func0<Observable<T>>() {
            @Override
            public Observable<T> call() {
                try {
                    return Observable.just(generateData(request));
                } catch (InterruptedException | ExecutionException e) {
                    VolleyXLog.e(e.getMessage());
                    return Observable.error(e);
                }
            }
        });
    }

}

class VolleyXTest  {

    @Mock RequestQueue mockReqeustQueue;
    @Mock Request mockRequest;

    @Test
    public void testFrom1() throws Exception {

        VolleyX.sInited = true;

        assertThat(VolleyX.from(mockRequest, ""), is(instanceOf(Observable.class)));
    }

}