@Test public void testPut() { PaintMap m1 = new PaintMap(); m1.put("A", Color.RED); assertEquals(Color.RED, m1.getPaint("A")); try { m1.put(null, Color.BLUE); fail("IllegalArgumentException should have been thrown on null key"); } catch (IllegalArgumentException e) { assertEquals("Null 'key' argument.", e.getMessage()); } }
public void put(Comparable key, Paint paint) { ParamChecks.nullNotPermitted(key, "key"); this.store.put(key, paint); }
PaintMap implements Cloneable, Serializable { public void put(Comparable key, Paint paint) { ParamChecks.nullNotPermitted(key, "key"); this.store.put(key, paint); } }
PaintMap implements Cloneable, Serializable { public void put(Comparable key, Paint paint) { ParamChecks.nullNotPermitted(key, "key"); this.store.put(key, paint); } PaintMap(); }
PaintMap implements Cloneable, Serializable { public void put(Comparable key, Paint paint) { ParamChecks.nullNotPermitted(key, "key"); this.store.put(key, paint); } PaintMap(); Paint getPaint(Comparable key); boolean containsKey(Comparable key); void put(Comparable key, Paint paint); void clear(); @Override boolean equals(Object obj); @Override Object clone(); }
PaintMap implements Cloneable, Serializable { public void put(Comparable key, Paint paint) { ParamChecks.nullNotPermitted(key, "key"); this.store.put(key, paint); } PaintMap(); Paint getPaint(Comparable key); boolean containsKey(Comparable key); void put(Comparable key, Paint paint); void clear(); @Override boolean equals(Object obj); @Override Object clone();  }