public void add(T element) {
        Preconditions.checkNotNull(element);
        if (elements.add(element) && elements.size() > maxSize) {
            elements.poll();
        }
    }
@Test
    void testAddNullHandling() {
        final BoundedFIFOQueue<Integer> testInstance = new BoundedFIFOQueue<>(1);
        assertThatThrownBy(() -> testInstance.add(null))
                .withFailMessage("A NullPointerException is expected to be thrown.")
                .isInstanceOf(NullPointerException.class);

        assertThat(testInstance).isEmpty();
    }