### Question:
EditForm extends XWikiForm { public Map<String, List<Integer>> getObjectsToAdd() { return objectsToAdd; }  @Override void readRequest(); void setTags(String[] parameter); String getTags(); String getContent(); void setContent(String content); String getWeb(); void setWeb(String web); String getName(); void setName(String name); String getLanguage(); void setLanguage(String language); int getObjectNumbers(String prefix); Map<String, String[]> getObject(String prefix); String getParent(); void setParent(String parent); String getCreator(); void setCreator(String creator); String getTemplate(); void setTemplate(String template); String getDefaultTemplate(); void setDefaultTemplate(String defaultTemplate); String getDefaultLanguage(); void setDefaultLanguage(String defaultLanguage); String getTitle(); void setTitle(String title); String getComment(); void setComment(String comment); boolean isMinorEdit(); void setMinorEdit(boolean isMinorEdit); boolean isLockForce(); void setLockForce(boolean lockForce); String getSyntaxId(); void setSyntaxId(String syntaxId); String getHidden(); void setHidden(String hidden); ObjectPolicyType getObjectPolicy(); Map<String, List<Integer>> getObjectsToRemove(); Map<String, List<Integer>> getObjectsToAdd(); Map<String, SortedMap<Integer, Map<String, String[]>>> getUpdateOrCreateMap();  }### Answer:
@Test public void getObjectsToAdd() { when(this.httpRequest.getParameterValues("addedObjects")).thenReturn(null); this.editForm.readRequest(); assertEquals(Collections.emptyMap(), this.editForm.getObjectsToAdd()); when(this.httpRequest.getParameterValues("addedObjects")).thenReturn(new String[] { "" }); this.editForm.readRequest(); assertEquals(Collections.emptyMap(), this.editForm.getObjectsToAdd()); when(this.httpRequest.getParameterValues("addedObjects")).thenReturn(new String[] { "XWiki.XWikiRights_42", "XWiki.XWikiRights_02", "XWiki.XWikiRights_foo", "", "MyClass_18_param.WebHome_0_Something_18", "EditIT.saveActionValidatesWhenXValidateIsPresent.WebHome_0", "XWiki.MyClass_1", "XWiki.XWikiRights_23", "AnotherClass_010", "foo_18_22", "_29" }); this.editForm.readRequest(); Map<String, List<Integer>> expectedMap = new HashMap<>(); expectedMap.put("XWiki.XWikiRights", Arrays.asList(42, 2, 23)); expectedMap.put("XWiki.MyClass", Collections.singletonList(1)); expectedMap.put("MyClass_18_param.WebHome_0_Something", Collections.singletonList(18)); expectedMap.put("EditIT.saveActionValidatesWhenXValidateIsPresent.WebHome", Collections.singletonList(0)); assertEquals(expectedMap, this.editForm.getObjectsToAdd()); }