@Test public void add() throws Exception { SymmetricIdentityMatrix<Integer> m = SymmetricIdentityMatrix.create(); assertTrue(m.contains(1,1)); assertFalse(m.contains(1,2)); m.add(1,2); assertTrue(m.contains(1,1)); assertTrue(m.contains(1,2)); assertTrue(m.contains(2,1)); assertFalse(m.contains(1,3)); m.add(2,1); assertTrue(m.contains(1,1)); assertTrue(m.contains(1,2)); assertTrue(m.contains(2,1)); assertFalse(m.contains(1,3)); m.add(3,1); assertTrue(m.contains(1,1)); assertTrue(m.contains(1,2)); assertTrue(m.contains(2,1)); assertTrue(m.contains(1,3)); assertTrue(m.contains(3, 1)); m.remove(2); assertTrue(m.contains(1,1)); assertFalse(m.contains(1,2)); assertFalse(m.contains(2,1)); assertTrue(m.contains(2,2)); assertTrue(m.contains(1,3)); assertTrue(m.contains(3, 1)); }
public void add(T val1, T val2) { if (!matches.containsKey(val1)) { matches.put(val1, Sets.newHashSet()); } matches.get(val1).add(val2); }
SymmetricIdentityMatrix { public void add(T val1, T val2) { if (!matches.containsKey(val1)) { matches.put(val1, Sets.newHashSet()); } matches.get(val1).add(val2); } }
SymmetricIdentityMatrix { public void add(T val1, T val2) { if (!matches.containsKey(val1)) { matches.put(val1, Sets.newHashSet()); } matches.get(val1).add(val2); } private  SymmetricIdentityMatrix(); }
SymmetricIdentityMatrix { public void add(T val1, T val2) { if (!matches.containsKey(val1)) { matches.put(val1, Sets.newHashSet()); } matches.get(val1).add(val2); } private  SymmetricIdentityMatrix(); static SymmetricIdentityMatrix<T> create(); void add(T val1, T val2); void remove(T val); boolean contains(T val1, T val2); }
SymmetricIdentityMatrix { public void add(T val1, T val2) { if (!matches.containsKey(val1)) { matches.put(val1, Sets.newHashSet()); } matches.get(val1).add(val2); } private  SymmetricIdentityMatrix(); static SymmetricIdentityMatrix<T> create(); void add(T val1, T val2); void remove(T val); boolean contains(T val1, T val2);  }