MetadataElement implements NameValuePair, Cloneable { @Override public void setKey(String key) { this.key = Args.notBlank(key, "key"); } MetadataElement();  MetadataElement(KeyValuePair kp);  MetadataElement(String key, String value); @Override void setKey(String key); @Override String getKey(); @Override void setValue(String value); @Override String getValue(); @Override String toString(); @Override boolean equals(Object obj); @Override int hashCode(); @Override Object clone();  }
@Test public void testSetKey() { try { me1.setKey(null); fail("should raise an IllegalArgumentException"); } catch (IllegalArgumentException e) { } try { me1.setKey(""); fail("should raise an IllegalArgumentException"); } catch (IllegalArgumentException e) { } }