public void testGetAll() { OneToManyMap<String, String> map0 = new OneToManyMap<>(); Iterator<String> i = map0.getAll(s0); assertNotNull( i ); assertFalse( i.hasNext() ); assertNotNull( i ); assertTrue( i.hasNext() ); assertEquals( s1, i.next() ); assertFalse( i.hasNext() ); assertNotNull( i ); boolean founds1 = false, founds2 = false; while (i.hasNext()) { assertTrue( founds1 ); assertTrue( founds2 );
public void testGet() { OneToManyMap<String, String> map0 = new OneToManyMap<>(); assertNull( map0.get( s0 )); map0.put( s0, s1 ); assertEquals( s1, map0.get( s0 )); map0.put( s0, s2 ); assertTrue( map0.get( s0 ).equals( s1 ) || map0.get( s0 ).equals( s2 )); }
public void testConstruct0() { // the types of these maps OneToManyMap<String, Integer> map0 = new OneToManyMap<>(); assertNotNull( map0 ); assertTrue( map0.isEmpty() ); OneToManyMap<String, Integer> map1 = new OneToManyMap<>( map0 ); assertNotNull( map1 ); assertTrue( map1.isEmpty() ); }
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 testKeySet() { OneToManyMap<String, String> map0 = new OneToManyMap<>(); Set<String> keys = new HashSet<>(); assertEquals( keys, map0.keySet() ); map0.put( s0, s1 ); keys.add( s0 ); assertEquals( keys, map0.keySet() ); map0.put( s2, s1 ); keys.add( s2 ); assertEquals( keys, map0.keySet() ); }
assertTrue( s0s1 ); assertTrue( s0s2 ); assertTrue( s3s4 );
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 testKeySet() { OneToManyMap<String, String> map0 = new OneToManyMap<>(); Set<String> keys = new HashSet<>(); assertEquals( keys, map0.keySet() ); map0.put( s0, s1 ); keys.add( s0 ); assertEquals( keys, map0.keySet() ); map0.put( s2, s1 ); keys.add( s2 ); assertEquals( keys, map0.keySet() ); }
public void testConstruct0() { // the types of these maps OneToManyMap<String, Integer> map0 = new OneToManyMap<>(); assertNotNull( map0 ); assertTrue( map0.isEmpty() ); OneToManyMap<String, Integer> map1 = new OneToManyMap<>( map0 ); assertNotNull( map1 ); assertTrue( map1.isEmpty() ); }
assertTrue( s0s1 ); assertTrue( s0s2 ); assertTrue( s3s4 );
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 testGetAll() { OneToManyMap<String, String> map0 = new OneToManyMap<>(); Iterator<String> i = map0.getAll(s0); assertNotNull( i ); assertFalse( i.hasNext() ); assertNotNull( i ); assertTrue( i.hasNext() ); assertEquals( s1, i.next() ); assertFalse( i.hasNext() ); assertNotNull( i ); boolean founds1 = false, founds2 = false; while (i.hasNext()) { assertTrue( founds1 ); assertTrue( founds2 );
public void testGet() { OneToManyMap<String, String> map0 = new OneToManyMap<>(); assertNull( map0.get( s0 )); map0.put( s0, s1 ); assertEquals( s1, map0.get( s0 )); map0.put( s0, s2 ); assertTrue( map0.get( s0 ).equals( s1 ) || map0.get( s0 ).equals( s2 )); }
public void testValues() { OneToManyMap<String, String> map0 = new OneToManyMap<>(); Set<String> vals = new HashSet<>(); assertEquals( vals, map0.values() ); map0.put( s0, s1 ); vals.add( s1 ); assertEquals( vals, map0.values() ); map0.put( s2, s1 ); assertEquals( vals, map0.values() ); map0.put( s2, s3 ); vals.add( s3 ); assertEquals( vals, map0.values() ); }
public void testRemove0() { OneToManyMap<String, String> map0 = new OneToManyMap<>(); map0.put( s0, s1 ); map0.put( s3, s4 ); map0.remove( s0 ); map0.remove( s3 ); assertTrue( map0.isEmpty() ); }
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 testValues() { OneToManyMap<String, String> map0 = new OneToManyMap<>(); Set<String> vals = new HashSet<>(); assertEquals( vals, map0.values() ); map0.put( s0, s1 ); vals.add( s1 ); assertEquals( vals, map0.values() ); map0.put( s2, s1 ); assertEquals( vals, map0.values() ); map0.put( s2, s3 ); vals.add( s3 ); assertEquals( vals, map0.values() ); }
public void testRemove0() { OneToManyMap<String, String> map0 = new OneToManyMap<>(); map0.put( s0, s1 ); map0.put( s3, s4 ); map0.remove( s0 ); map0.remove( s3 ); assertTrue( map0.isEmpty() ); }
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 testSize() { OneToManyMap<String, String> map0 = new OneToManyMap<>(); assertEquals( 0, map0.size() ); map0.put( s0, s1 ); assertEquals( 1, map0.size() ); map0.put( s0, s2 ); assertEquals( 2, map0.size() ); map0.put( s3, s4 ); assertEquals( 3, map0.size() ); map0.remove( s0, s2 ); assertEquals( 2, map0.size() ); map0.remove( s3, s4 ); assertEquals( 1, map0.size() ); map0.remove( s0, s1 ); assertEquals( 0, map0.size() ); }