AHashSet extends MapAsSetWrapper<T, AHashSet<T>> { public static <T> AHashSet<T> empty () { return empty (AEquality.EQUALS); } private  AHashSet(AMap<T, ?> inner); static AHashSet<T> empty(); @SuppressWarnings ("unchecked") static AHashSet<T> empty(AEquality equality); @SuppressWarnings ("unchecked") static AHashSet<T> create(T... elements); static AHashSet<T> create(Iterable<T> elements); @SuppressWarnings ("unchecked") static AHashSet<T> create(AEquality equality, T... elements); static AHashSet<T> create(AEquality equality, Iterable<T> elements); static AHashSet<T> fromMap(AHashMap<T, ?> inner);  }
@Test public void testEmpty() { assertEquals(0, AHashSet.empty ().size()); assertTrue(AHashSet.empty ().asJavaUtilSet().isEmpty()); }
@Test public void testAddRemoveContains() { assertFalse(AHashSet.empty ().contains("a")); assertTrue (AHashSet.empty ().with("a").contains("a")); assertFalse(AHashSet.empty ().with("a").contains("b")); assertTrue (AHashSet.empty ().with("a").with("b").contains("b")); assertFalse(AHashSet.empty ().with("a").with("b").contains("c")); assertFalse(AHashSet.empty ().with("a").with("b").without("a").contains("a")); assertTrue (AHashSet.empty ().with("a").with("b").without("a").contains("b")); assertFalse(AHashSet.empty ().with("a").with("b").without("a").contains("c")); }
@Test public void testEquals2() { assertEquals(AHashSet.empty (), AHashSet.empty ()); assertEquals(AHashSet.empty ().with("a"), AHashSet.empty ().with("a")); assertEquals(AHashSet.empty ().with("a").with("b"), AHashSet.empty ().with("b").with("a")); assertNotEquals(AHashSet.empty (), AHashSet.empty ().with("a")); assertNotEquals(AHashSet.empty ().with("a"), AHashSet.empty ()); assertNotEquals(AHashSet.empty ().with("a").with("b"), AHashSet.empty ().with("a").with("b").with("c")); assertNotEquals(AHashSet.empty ().with("a").with("b").with("c"), AHashSet.empty ().with("a").with("b")); assertNotEquals(AHashSet.empty ().with("a").with("b").with("c"), AHashSet.empty ().with("b").with("c")); assertNotEquals(AHashSet.empty (), null); }
@Test public void testMkString() { assertEquals("%&", AHashSet.empty () .mkString("%", "--", "&")); assertEquals("%a&", AHashSet.empty ().with("a") .mkString("%", "--", "&")); final String s1 = AHashSet.empty ().with("a").with("b").mkString("%", "--", "&"); assertTrue("%b--a&".equals(s1) || "%a--b&".equals(s1)); assertEquals("", AHashSet.empty () .mkString("#")); assertEquals("a", AHashSet.empty ().with("a") .mkString("#")); final String s2 = AHashSet.empty ().with("a").with("b").mkString("#"); assertTrue("b#a".equals(s2) || "a#b".equals(s2)); }