ProcessBag implements Serializable { public void addProperty(String key, Object value) throws ProcessBagException { if (properties.containsKey(key)) { throw new ProcessBagException(key + " already used!"); } else { properties.put(key, value); } } ProcessBag();  ProcessBag(Map<String, Object> properties);  ProcessBag(ProcessBag bag); @Override boolean equals(Object obj); @Override int hashCode(); void setProcessId(String processId); String getProcessId(); void setContext(String context); String getContext(); void setUser(String user); String getUser(); void addProperty(String key, Object value); void addOrReplaceProperty(String key, Object value); Object getProperty(String key); void removeProperty(String key); boolean containsProperty(String key); Class<?> getPropertyClass(String key); Set<String> propertyKeySet(); int propertyCount(); void removeAllProperties(); Map<String, Object> getProperties(); void setProperties(Map<String, Object> properties);  }
@Test(expected = ProcessBagException.class) public void testAddProperty_shouldReturnException() { pb.addProperty("test", "42"); pb.addProperty("test", "42"); }