### Question:
ParseRole extends ParseObject { @Override void validateSave() { synchronized (mutex) { if (this.getObjectId() == null && getName() == null) { throw new IllegalStateException("New roles must specify a name."); } super.validateSave(); } } 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 testValidateSaveSuccess() { ParseRole role = new ParseRole("Test"); role.validateSave(); }
@Test public void testValidateSaveSuccessWithNoName() { ParseRole role = new ParseRole("Test"); role.setObjectId("test"); role.validateSave(); }
@Test(expected = IllegalStateException.class) public void testValidateSaveFailureWithNoObjectIdAndName() { ParseRole role = new ParseRole(); role.validateSave(); }