### Question:
ResourceAOHelper extends AOHelper { List<String> formatImmediateChildren(final String childrenString) { if (childrenString == null) { throw new IllegalArgumentException("null childrenString"); } List<String> immediateChildren = new ArrayList<String>(); if (childrenString.isEmpty()) { return immediateChildren; } String[] items = childrenString.split(";"); for (String item : items) { if (item.isEmpty()) { continue; } int idxBracket = item.indexOf("{"); if (idxBracket > -1) { immediateChildren.add(item.substring(0, idxBracket)); } else { immediateChildren.add(item); } } return immediateChildren; } protected  ResourceAOHelper(final IRODSAccount irodsAccount, final IRODSAccessObjectFactory irodsAccessObjectFactory);   }### Answer:
@Test public void testFormatImmediateChildrenNoChild() throws Exception { String testString = ""; ResourceAOHelper resourceAOHelper = new ResourceAOHelper(mockAccount, mockAccessObjectFactory); List<String> resources = resourceAOHelper.formatImmediateChildren(testString); Assert.assertTrue("should be empty children", resources.isEmpty()); }
@Test public void testFormatImmediateChildrenOneChild() throws Exception { String testString = "resource1{}"; ResourceAOHelper resourceAOHelper = new ResourceAOHelper(mockAccount, mockAccessObjectFactory); List<String> resources = resourceAOHelper.formatImmediateChildren(testString); Assert.assertEquals("should have 1 entry", 1, resources.size()); Assert.assertEquals("resc1 first", "resource1", resources.get(0)); }
@Test public void testFormatImmediateChildren() throws Exception { String testString = "resource1{};resource2{}"; ResourceAOHelper resourceAOHelper = new ResourceAOHelper(mockAccount, mockAccessObjectFactory); List<String> resources = resourceAOHelper.formatImmediateChildren(testString); Assert.assertEquals("should have two enries", 2, resources.size()); Assert.assertEquals("resc1 first", "resource1", resources.get(0)); Assert.assertEquals("resc2 second", "resource2", resources.get(1)); }