### Question:
CoreDepthFirstVoidVisitor extends DepthFirstVoidVisitor { public UserInstance getUserInstance() { return userInstance; }  ApplicationInstance getApplicationInstance(); PaaSInstance getPaaSInstance(); UserInstance getUserInstance(); @Override void visit(ApplicationProfile n); @Override void visit(ApplicationInfos n); @Override void visit(ApplicationCode n); @Override void visit(File n); @Override void visit(FileDimension n); @Override void visit(Digest n); @Override void visit(TechnologyInfo n); @Override void visit(Software n); @Override void visit(SoftwareCategory n); @Override void visit(Component n); @Override void visit(SoftwareComponent n); @Override void visit(Description n); @Override void visit(Version n); @Override void visit(License n); @Override void visit(BoxComponent n); @Override void visit(ComputationalComponent n); @Override void visit(CommunicationalComponent n); @Override void visit(Latency n); @Override void visit(StorageComponent n); @Override void visit(Bandwidth n); @Override void visit(PaasOfferingProfile n); @Override void visit(PaasOfferingInfos n); @Override void visit(Api n); @Override void visit(Cli n); @Override void visit(WebInterface n); @Override void visit(Operation n); @Override void visit(UserProfile n); @Override void visit(Provider n); @Override void visit(AccountInfo n); @Override void visit(PersonalInfos n); @Override void visit(Birthday n);  }### Answer:
@Test public void TestUserProfile() throws FileNotFoundException, ParseException{ InputStream is = readFile("userProfile.txt"); cpp.ReInit(is); CoreDepthFirstVoidVisitor visitor = null; try { Scope scope = cpp.Scope(); visitor = new CoreDepthFirstVoidVisitor(); scope.accept(visitor); } catch (Exception e) { Assert.fail("Exception: "+e); } UserInstance userInstance = visitor.getUserInstance(); Assert.assertNotNull(userInstance); logger.debug("UserInstance" + userInstance); Assert.assertTrue("UserInstance is not a DeveloperInstance", (userInstance instanceof DeveloperInstance)); DeveloperInstance developer = (DeveloperInstance)userInstance; Assert.assertEquals("DeveloperInstance Accountname is different", "vlaudizio", developer.getAccountname()); Assert.assertEquals("DeveloperInstance Firstname is different", "Vincenzo", developer.getFirstName()); Assert.assertEquals("DeveloperInstance Surname is different", "Laudizio", developer.getSurname()); Assert.assertEquals("DeveloperInstance Email is different", "vincenzo.laudizio@gmail.com", developer.getPersonalmailbox()); try { is.close(); } catch (IOException ex) { logger.error("Error closing the stream", ex); } }
@Test public void TestUserProfile1() throws FileNotFoundException, ParseException{ InputStream is = readFile("userProfile_1.txt"); cpp.ReInit(is); CoreDepthFirstVoidVisitor visitor = null; try { Scope scope = cpp.Scope(); visitor = new CoreDepthFirstVoidVisitor(); scope.accept(visitor); } catch (Exception e) { Assert.fail("Exception: "+e); } UserInstance userInstance = visitor.getUserInstance(); Assert.assertNotNull(userInstance); logger.debug("UserInstance" + userInstance); Assert.assertTrue("UserInstance is not a PaaSUserInstance", (userInstance instanceof PaaSUserInstance)); PaaSUserInstance provider = (PaaSUserInstance)userInstance; Assert.assertEquals("PaaSUserInstance PaaSProvider Name is different", "CloudBees", provider.getPaaSProviderInstance().getTitle()); Assert.assertEquals("PaaSUserInstance PaaSProvider HomePage is different", "http: Assert.assertEquals("PaaSUserInstance Accountname is different", "CloudBees", provider.getAccountname()); Assert.assertEquals("PaaSUserInstance Firstname is different", "CloudBees", provider.getFirstName()); Assert.assertEquals("PaaSUserInstance Surname is different", "CloudBees", provider.getSurname()); Assert.assertEquals("PaaSUserInstance Email is different", "support@cloudbees.com", provider.getPersonalmailbox()); try { is.close(); } catch (IOException ex) { logger.error("Error closing the stream", ex); } }