### Question:
ParseRole extends ParseObject { @Override public void put(String key, Object value) { if ("name".equals(key)) { if (this.getObjectId() != null) { throw new IllegalArgumentException( "A role's name can only be set before it has been saved."); } if (!(value instanceof String)) { throw new IllegalArgumentException("A role's name must be a String."); } if (!NAME_PATTERN.matcher((String) value).matches()) { throw new IllegalArgumentException( "A role's name can only contain alphanumeric characters, _, -, and spaces."); } } super.put(key, value); } ParseRole();  ParseRole(String name);  ParseRole(String name, ParseACL acl); void setName(String name); String getName(); ParseRelation<ParseUser> getUsers(); ParseRelation<ParseRole> getRoles(); @Override void put(String key, Object value); static ParseQuery<ParseRole> getQuery();  }### Answer:
@Test public void testPutSuccess() { ParseRole role = new ParseRole("Test"); role.put("key", "value"); assertEquals("value", role.get("key")); }
@Test(expected = IllegalArgumentException.class) public void testPutFailureWithNameAndObjectIdSet() { ParseRole role = new ParseRole("Test"); role.setObjectId("objectId"); role.put("name", "value"); }
@Test(expected = IllegalArgumentException.class) public void testPutFailureWithInvalidNameTypeSet() { ParseRole role = new ParseRole("Test"); role.put("name", 1); }
@Test(expected = IllegalArgumentException.class) public void testPutFailureWithInvalidNameValueSet() { ParseRole role = new ParseRole("Test"); role.put("name", "!!!!"); }