    @Test
    public void testUploadEventWithoutWait() throws IOException {

        Queue.UploadRequester uploadRequester = mock(Queue.UploadRequester.class);

        Queue queue = new Queue(null, USER_ID_PROVIDER, uploadRequester,
                new Queue.Config.Builder()
                        .withUploadWhenMoreThan(5)
                        .withUploadWhenOlderThan(10000)
                        .build());

        MobileEventJson event = new MobileEventJson()
                .withAndroidDeviceProperties(new AndroidDevicePropertiesJson()
                        .withAndroidId("foo0")
                        .withDeviceManufacturer("bar0")
                        .withDeviceModel("baz0")
                )
                .withTime(System.currentTimeMillis());

        // Should have uploaded the first event
        queue.append(event);
        verify(uploadRequester).requestUpload(Collections.singletonList(event));
        reset(uploadRequester);

        // Should not have uploaded the second event (not stale enough)
        queue.append(event);
        verifyZeroInteractions(uploadRequester);
    }