public void add(T element) {
        Preconditions.checkNotNull(element);
        if (elements.add(element) && elements.size() > maxSize) {
            elements.poll();
        }
    }
@Test
    void testQueueWithMaxSize2() {
        final BoundedFIFOQueue<Integer> testInstance = new BoundedFIFOQueue<>(2);
        assertThat(testInstance).isEmpty();

        testInstance.add(1);
        assertThat(testInstance).contains(1);

        testInstance.add(2);
        assertThat(testInstance).contains(1, 2);

        testInstance.add(3);
        assertThat(testInstance).contains(2, 3);
    }