@@ -0,0 +1,2808 @@
+/*%0A * Copyright 2016-present Open Networking Laboratory%0A *%0A * Licensed under the Apache License, Version 2.0 (the %22License%22);%0A * you may not use this file except in compliance with the License.%0A * You may obtain a copy of the License at%0A *%0A *     http://www.apache.org/licenses/LICENSE-2.0%0A *%0A * Unless required by applicable law or agreed to in writing, software%0A * distributed under the License is distributed on an %22AS IS%22 BASIS,%0A * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A * See the License for the specific language governing permissions and%0A * limitations under the License.%0A */%0A%0Apackage org.onosproject.store.resource.impl;%0A%0Aimport com.google.common.collect.ImmutableSet;%0Aimport org.junit.Test;%0Aimport org.onosproject.net.DeviceId;%0Aimport org.onosproject.net.resource.DiscreteResource;%0Aimport org.onosproject.net.resource.Resources;%0A%0Aimport java.util.Optional;%0A%0Aimport static org.hamcrest.Matchers.is;%0Aimport static org.junit.Assert.*;%0A%0Apublic class EmptyDiscreteResourcesTest %7B%0A    private EmptyDiscreteResources sut = EmptyDiscreteResources.INSTANCE;%0A%0A    @Test%0A    public void testLookup() %7B%0A        assertThat(sut.lookup(Resources.discrete(DeviceId.deviceId(%22a%22)).id()), is(Optional.empty()));%0A    %7D%0A%0A    @Test%0A    public void testDifference() %7B%0A        DiscreteResource res1 = Resources.discrete(DeviceId.deviceId(%22a%22)).resource();%0A        DiscreteResource res2 = Resources.discrete(DeviceId.deviceId(%22b%22)).resource();%0A%0A        assertThat(sut.difference(DiscreteResources.of(ImmutableSet.of(res1))),%0A                is(EmptyDiscreteResources.INSTANCE));%0A        assertThat(sut.difference(DiscreteResources.of(ImmutableSet.of(res2))),%0A                is(EmptyDiscreteResources.INSTANCE));%0A    %7D%0A%0A    @Test%0A    public void testIsEmpty() %7B%0A        assertThat(sut.isEmpty(), is(true));%0A    %7D%0A%0A    @Test%0A    public void testContainsAny() %7B%0A        DiscreteResource res1 = Resources.discrete(DeviceId.deviceId(%22a%22)).resource();%0A        DiscreteResource res2 = Resources.discrete(DeviceId.deviceId(%22b%22)).resource();%0A%0A        assertThat(sut.containsAny(ImmutableSet.of(res1)), is(false));%0A        assertThat(sut.containsAny(ImmutableSet.of(res2)), is(false));%0A    %7D%0A%0A    @Test%0A    public void testAdd() %7B%0A        DiscreteResource res1 = Resources.discrete(DeviceId.deviceId(%22a%22)).resource();%0A        DiscreteResource res2 = Resources.discrete(DeviceId.deviceId(%22b%22)).resource();%0A%0A        assertThat(sut.add(DiscreteResources.of(ImmutableSet.of(res1))),%0A                is(DiscreteResources.of(ImmutableSet.of(res1))));%0A        assertThat(sut.add(DiscreteResources.of(ImmutableSet.of(res2))),%0A                is(DiscreteResources.of(ImmutableSet.of(res2))));%0A    %7D%0A%0A    @Test%0A    public void testValues() %7B%0A        assertThat(sut.values(), is(ImmutableSet.of()));%0A    %7D%0A%7D%0A

Add unit tests for EmptyDiscreteResources