@Test public void addLinkTest() { Root root = new Root(); assertEquals(null, root.getLinks()); Link link = new Link(); root.addLink(link); assertEquals(link, root.getLinks().get(0)); }
public void addLink(Link link) { if(links==null) links = new ArrayList<Link>(); links.add(link); }
Root { public void addLink(Link link) { if(links==null) links = new ArrayList<Link>(); links.add(link); } }
Root { public void addLink(Link link) { if(links==null) links = new ArrayList<Link>(); links.add(link); }  }
Root { public void addLink(Link link) { if(links==null) links = new ArrayList<Link>(); links.add(link); }  String getHref(); void setHref(String href); String getVersion(); void setVersion(String version); String getTimestamp(); void setTimestamp(String timestamp); List<Link> getLinks(); void setLinks(List<Link> links); void addLink(Link link); }
Root { public void addLink(Link link) { if(links==null) links = new ArrayList<Link>(); links.add(link); }  String getHref(); void setHref(String href); String getVersion(); void setVersion(String version); String getTimestamp(); void setTimestamp(String timestamp); List<Link> getLinks(); void setLinks(List<Link> links); void addLink(Link link);  }