NCMBRole extends NCMBBase { public void addUser(List<NCMBUser> users) throws NCMBException { NCMBRoleService roleService = (NCMBRoleService) NCMB.factory(NCMB.ServiceType.ROLE); try { JSONObject res = roleService.addUserRelations(getObjectId(), users); SimpleDateFormat df = NCMBDateFormat.getIso8601(); mFields.put("updateDate", res.getString("updateDate")); } catch (NCMBException e) { throw e; } catch (JSONException e) { throw new NCMBException(NCMBException.INVALID_JSON, e.getMessage()); } } NCMBRole();  NCMBRole(String name);   NCMBRole(JSONObject params); static NCMBQuery<NCMBRole> getQuery(); String getRoleName(); void setRoleName(String name); void addUser(List<NCMBUser> users); void addUserInBackground(List<NCMBUser> users, final DoneCallback callback); void removeUser(List<NCMBUser> users); void removeUserInBackground(List<NCMBUser> users, final DoneCallback callback); void addRole(List<NCMBRole> roles); void addRoleInBackground(List<NCMBRole> roles, final DoneCallback callback); void removeRole(List<NCMBRole> roles); void removeRoleInBackground(List<NCMBRole> roles, final DoneCallback callback); void createRole(); void createRoleInBackground(final DoneCallback callback); void fetchObject(); void fetchObjectInBackground(final FetchCallback callback); void deleteObject(); void deleteObjectInBackground(final DoneCallback callback);  }
@Test public void addUser() throws Exception { NCMBUser user1 = new NCMBUser(); user1.setObjectId("dummyUserObjectId1"); NCMBUser user2 = new NCMBUser(); user2.setObjectId("dummyUserObjectId2"); NCMBRole role = new NCMBRole("testRole"); role.setObjectId("dummyRoleId"); role.addUser(Arrays.asList(user1, user2)); SimpleDateFormat df = NCMBDateFormat.getIso8601(); Assert.assertEquals(df.parse("2014-06-04T11:28:30.348Z"), role.getUpdateDate()); }