@@ -0,0 +1,2667 @@
+package no.ssb.vtl.script.operations;%0A%0Aimport com.google.common.collect.ImmutableMap;%0Aimport no.ssb.vtl.model.Component;%0Aimport no.ssb.vtl.model.DataPoint;%0Aimport no.ssb.vtl.model.DataStructure;%0Aimport no.ssb.vtl.model.Dataset;%0Aimport no.ssb.vtl.model.VTLBoolean;%0Aimport org.junit.Before;%0Aimport org.junit.Test;%0A%0Aimport java.util.Collections;%0Aimport java.util.List;%0Aimport java.util.Map;%0Aimport java.util.Optional;%0Aimport java.util.stream.Stream;%0A%0Aimport static org.assertj.core.api.Assertions.*;%0A%0Apublic class FilterOperationTest %7B%0A%0A    private Dataset dataset;%0A%0A    @Before%0A    public void setUp() throws Exception %7B%0A        DataStructure structure = DataStructure.builder()%0A                .put(%22id%22, Component.Role.IDENTIFIER, String.class)%0A                .build();%0A%0A        DataPoint dataPoint = structure.wrap(ImmutableMap.of(%22id%22, %22idValue%22));%0A        List%3CDataPoint%3E dataPoints = Collections.singletonList(dataPoint);%0A%0A        dataset = new TestableDataset(structure, dataPoints);%0A    %7D%0A%0A    @Test%0A    public void testPredicateReturnsNull() throws Exception %7B%0A%0A        FilterOperation resultBooleanNull = new FilterOperation(dataset, dp -%3E VTLBoolean.of(null));%0A        assertThat(resultBooleanNull.getData()).isEmpty();%0A%0A        FilterOperation resultNull = new FilterOperation(dataset, dp -%3E null);%0A        assertThat(resultNull.getData()).isEmpty();%0A    %7D%0A%0A    @Test%0A    public void testPredicateReturnsFalse() throws Exception %7B%0A%0A        FilterOperation result = new FilterOperation(dataset, dp -%3E VTLBoolean.of(Boolean.FALSE));%0A        assertThat(result.getData()).isEmpty();%0A    %7D%0A%0A%0A    @Test%0A    public void testPredicateReturnsTrue() throws Exception %7B%0A%0A        FilterOperation result = new FilterOperation(dataset, dp -%3E VTLBoolean.of(Boolean.TRUE));%0A        assertThat(result.getData()).isNotEmpty();%0A    %7D%0A%0A    private static class TestableDataset implements Dataset %7B%0A%0A        private final List%3CDataPoint%3E dataPoints;%0A        private final DataStructure structure;%0A%0A        private TestableDataset(DataStructure structure, List%3CDataPoint%3E dataPoints) %7B%0A            this.dataPoints = dataPoints;%0A            this.structure = structure;%0A        %7D%0A%0A        @Override%0A        public Stream%3CDataPoint%3E getData() %7B%0A            return dataPoints.stream();%0A        %7D%0A%0A        @Override%0A        public Optional%3CMap%3CString, Integer%3E%3E getDistinctValuesCount() %7B%0A            return Optional.empty();%0A        %7D%0A%0A        @Override%0A        public Optional%3CLong%3E getSize() %7B%0A            return Optional.of((long) dataPoints.size());%0A        %7D%0A%0A        @Override%0A        public DataStructure getDataStructure() %7B%0A            return structure;%0A        %7D%0A    %7D%0A%7D%0A%0A

Add a simple test for the FilterOperation that check that null values are handled as false