/** * Set to true to enable derivation caching */ @Override public void setDerivationLogging(boolean recordDerivations) { this.recordDerivations = recordDerivations; engine.setDerivationLogging(recordDerivations); if (recordDerivations) { derivations = new OneToManyMap<>(); } else { derivations = null; } }
/** * Set to true to enable derivation caching */ @Override public void setDerivationLogging(boolean recordDerivations) { engine.setDerivationLogging(recordDerivations); if (recordDerivations) { derivations = new OneToManyMap<>(); } else { derivations = null; } }
/** * Set to true to enable derivation caching */ @Override public void setDerivationLogging(boolean recordDerivations) { engine.setDerivationLogging(recordDerivations); if (recordDerivations) { derivations = new OneToManyMap<>(); } else { derivations = null; } }
public void testPutAll1() { OneToManyMap<String, String> map0 = new OneToManyMap<>(); map0.put( s0, s1 ); map0.put( s3, s4 ); Map<String, String> map1 = new HashMap<>(); map1.put( s3, s4 ); map1.put( s0, s1 ); OneToManyMap<String, String> map2 = new OneToManyMap<>(); map2.putAll( map1 ); assertEquals( map0, map2 ); }
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 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 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 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 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 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 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 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 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 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 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() ); }