public void testContainsKey() { OneToManyMap<String, String> map0 = new OneToManyMap<>(); assertFalse( map0.containsKey( s0 ) ); assertFalse( map0.containsKey( s1 ) ); map0.put( s0, s1 ); assertTrue( map0.containsKey( s0 ) ); assertFalse( map0.containsKey( s1 ) ); }
public void testContainsKey() { OneToManyMap<String, String> map0 = new OneToManyMap<>(); assertFalse( map0.containsKey( s0 ) ); assertFalse( map0.containsKey( s1 ) ); map0.put( s0, s1 ); assertTrue( map0.containsKey( s0 ) ); assertFalse( map0.containsKey( s1 ) ); }
public void testContainsValue() { OneToManyMap<String, String> map0 = new OneToManyMap<>(); assertFalse( map0.containsValue( s0 ) ); assertFalse( map0.containsValue( s1 ) ); assertFalse( map0.containsValue( s2 ) ); map0.put( s0, s1 ); assertFalse( map0.containsValue( s0 ) ); assertTrue( map0.containsValue( s1 ) ); assertFalse( map0.containsValue( s2 ) ); map0.put( s0, s2 ); assertFalse( map0.containsValue( s0 ) ); assertTrue( map0.containsValue( s1 ) ); assertTrue( map0.containsValue( s2 ) ); }
public void testContains() { OneToManyMap<String, String> map0 = new OneToManyMap<>(); assertFalse( map0.contains( s0, s1 ) ); assertFalse( map0.contains( s0, s2 ) ); assertFalse( map0.contains( s1, s2 ) ); map0.put( s0, s1 ); assertTrue( map0.contains( s0, s1 ) ); assertFalse( map0.contains( s0, s2 ) ); assertFalse( map0.contains( s1, s2 ) ); map0.put( s0, s2 ); assertTrue( map0.contains( s0, s1 ) ); assertTrue( map0.contains( s0, s2 ) ); assertFalse( map0.contains( s1, s2 ) ); }
public void testContainsValue() { OneToManyMap<String, String> map0 = new OneToManyMap<>(); assertFalse( map0.containsValue( s0 ) ); assertFalse( map0.containsValue( s1 ) ); assertFalse( map0.containsValue( s2 ) ); map0.put( s0, s1 ); assertFalse( map0.containsValue( s0 ) ); assertTrue( map0.containsValue( s1 ) ); assertFalse( map0.containsValue( s2 ) ); map0.put( s0, s2 ); assertFalse( map0.containsValue( s0 ) ); assertTrue( map0.containsValue( s1 ) ); assertTrue( map0.containsValue( s2 ) ); }
public void testContains() { OneToManyMap<String, String> map0 = new OneToManyMap<>(); assertFalse( map0.contains( s0, s1 ) ); assertFalse( map0.contains( s0, s2 ) ); assertFalse( map0.contains( s1, s2 ) ); map0.put( s0, s1 ); assertTrue( map0.contains( s0, s1 ) ); assertFalse( map0.contains( s0, s2 ) ); assertFalse( map0.contains( s1, s2 ) ); map0.put( s0, s2 ); assertTrue( map0.contains( s0, s1 ) ); assertTrue( map0.contains( s0, s2 ) ); assertFalse( map0.contains( s1, s2 ) ); }
Iterator<String> i = map0.getAll(s0); assertNotNull( i ); assertFalse( i.hasNext() ); assertTrue( i.hasNext() ); assertEquals( s1, i.next() ); assertFalse( i.hasNext() );
public void testClear() { OneToManyMap<String, String> map0 = new OneToManyMap<>(); map0.put( s0, s1 ); assertTrue( map0.contains( s0, s1 ) ); assertFalse( map0.isEmpty() ); map0.clear(); assertFalse( map0.contains( s0, s1 ) ); assertTrue( map0.isEmpty() ); }
Iterator<String> i = map0.getAll(s0); assertNotNull( i ); assertFalse( i.hasNext() ); assertTrue( i.hasNext() ); assertEquals( s1, i.next() ); assertFalse( i.hasNext() );
public void testClear() { OneToManyMap<String, String> map0 = new OneToManyMap<>(); map0.put( s0, s1 ); assertTrue( map0.contains( s0, s1 ) ); assertFalse( map0.isEmpty() ); map0.clear(); assertFalse( map0.contains( s0, s1 ) ); assertTrue( map0.isEmpty() ); }
public void testConstruct1() { OneToManyMap<String, String> map0 = new OneToManyMap<>(); map0.put( s0, s1 ); assertTrue( map0.contains( s0, s1 ) ); OneToManyMap<String, String> map1 = new OneToManyMap<>( map0 ); assertTrue( map1.contains( s0, s1 ) ); map0.put( s0, s2 ); assertTrue( map0.contains( s0, s2 ) ); assertFalse( map1.contains( s0, s2 ) ); assertFalse( map0.contains( s1, s2 ) ); }
public void testConstruct1() { OneToManyMap<String, String> map0 = new OneToManyMap<>(); map0.put( s0, s1 ); assertTrue( map0.contains( s0, s1 ) ); OneToManyMap<String, String> map1 = new OneToManyMap<>( map0 ); assertTrue( map1.contains( s0, s1 ) ); map0.put( s0, s2 ); assertTrue( map0.contains( s0, s2 ) ); assertFalse( map1.contains( s0, s2 ) ); assertFalse( map0.contains( s1, s2 ) ); }
public void testRemove1() { OneToManyMap<String, String> map0 = new OneToManyMap<>(); map0.put( s0, s1 ); map0.put( s0, s2 ); map0.put( s3, s4 ); map0.remove( s0, s2 ); map0.remove( s3, s4 ); assertFalse( map0.isEmpty() ); map0.remove( s0, s1 ); assertTrue( map0.isEmpty() ); }
public void testRemove1() { OneToManyMap<String, String> map0 = new OneToManyMap<>(); map0.put( s0, s1 ); map0.put( s0, s2 ); map0.put( s3, s4 ); map0.remove( s0, s2 ); map0.remove( s3, s4 ); assertFalse( map0.isEmpty() ); map0.remove( s0, s1 ); assertTrue( map0.isEmpty() ); }
public void testEquals() { OneToManyMap<String, String> map0 = new OneToManyMap<>(); map0.put( s0, s1 ); map0.put( s0, s2 ); map0.put( s3, s4 ); OneToManyMap<String, String> map1 = new OneToManyMap<>(); map1.put( s3, s4 ); map1.put( s0, s1 ); map1.put( s0, s2 ); OneToManyMap<String, String> map2 = new OneToManyMap<>(); map2.put( s0, s2 ); map2.put( s3, s4 ); assertTrue( map0.equals( map1 ) ); assertTrue( map1.equals( map0 ) ); assertTrue( map0.hashCode() == map1.hashCode() ); assertFalse( map0.equals( map2 )); assertFalse( map2.equals( map0 )); }
public void testEquals() { OneToManyMap<String, String> map0 = new OneToManyMap<>(); map0.put( s0, s1 ); map0.put( s0, s2 ); map0.put( s3, s4 ); OneToManyMap<String, String> map1 = new OneToManyMap<>(); map1.put( s3, s4 ); map1.put( s0, s1 ); map1.put( s0, s2 ); OneToManyMap<String, String> map2 = new OneToManyMap<>(); map2.put( s0, s2 ); map2.put( s3, s4 ); assertTrue( map0.equals( map1 ) ); assertTrue( map1.equals( map0 ) ); assertTrue( map0.hashCode() == map1.hashCode() ); assertFalse( map0.equals( map2 )); assertFalse( map2.equals( map0 )); }