@Test public void subsetNotEmpty() { MutableSet<String> singletonSet = UnifiedSet.newSetWith("Bertha"); MutableSet<String> doubletonSet = UnifiedSet.newSetWith("Bertha", "Myra"); Assert.assertTrue(Sets.isSubsetOf(singletonSet, doubletonSet)); Assert.assertFalse(Sets.isSubsetOf(doubletonSet, singletonSet)); }
@Test public void subsetEqual() { MutableSet<String> setA = UnifiedSet.newSetWith("Bertha", null, "Myra"); MutableSet<String> setB = UnifiedSet.newSetWith("Myra", "Bertha", null); Assert.assertTrue(Sets.isSubsetOf(setA, setB)); Assert.assertTrue(Sets.isSubsetOf(setB, setA)); }
@Test public void subsetEmpty() { MutableSet<String> emptySet = mSet(); MutableSet<String> singletonSet = mSet("Bertha"); Assert.assertTrue(Sets.isSubsetOf(emptySet, singletonSet)); Assert.assertFalse(Sets.isSubsetOf(singletonSet, emptySet)); }