    @Test
    public void shouldFilterGeneratedValueUsingSuppliedPredicate() {

        //Given
        Generator<Integer> oddNumbers = new FilteringGenerator<>(new RandomFromCollectionGenerator<>(1, 2, 3, 4, 5), new Predicate<Integer>() {
            @Override
            public boolean apply(Integer input) {
                return input % 2 != 0;//only odd numbers
            }
        });

        //When & Then
        for (int i = 0; i < 10; i++) {
            assertThat(oddNumbers.next(), isOneOf(1, 3, 5));
        }
    }