ApplicationContextBean { @Override public String toString() { return this.name; }  String getName(); String getDescription(); Date getLastModified(); Collection<InstanceContextBean> getInstances(); Collection<String> getComponents(); Map<String, Set<InstanceContextBean>> getInstancesByType(); @Override String toString();  }
@Test public void testToString() { ApplicationContextBean ab = new ApplicationContextBean(); Assert.assertNull( ab.toString()); ab.name = "test"; Assert.assertEquals( ab.name, ab.toString()); VariableContextBean vb = new VariableContextBean(); Assert.assertNull( vb.toString()); vb.name = "tesst"; Assert.assertEquals( vb.name, vb.toString()); InstanceContextBean ib = new InstanceContextBean(); Assert.assertNull( ib.toString()); ib.name = "odg"; Assert.assertEquals( ib.name, ib.toString()); ImportContextBean impB = new ImportContextBean(); Assert.assertNotNull( impB.toString()); impB.instance = ib; Assert.assertTrue( impB.toString().endsWith( impB.instance.toString())); }