### Question:
Provider { public void addLink(Link link) { if(links==null) links = new ArrayList<Link>(); links.add(link); }  @Transient String getHref(); void setHref(String href); @Id @GeneratedValue(strategy=GenerationType.IDENTITY) @Column(name = "id", unique = true, nullable = false) int getId(); void setId(int id); @Column(name = "vmm_url", nullable = false) String getVmmUrl(); void setVmmUrl(String vmmUrl); @Column(name = "slam_url", nullable = false) String getSlamUrl(); void setSlamUrl(String slamUrl); @Column(name = "name", nullable = false) String getName(); void setName(String name); @Column(name = "amqp_url", nullable = true) String getAmqpUrl(); void setAmqpUrl(String amqpUrl); @Transient List<Link> getLinks(); void setLinks(List<Link> links); void addLink(Link link);  }### Answer:
@Test public void addLinkTest() { Provider provider = new Provider(); assertEquals(null, provider.getLinks()); Link link = new Link(); provider.addLink(link); assertEquals(1, provider.getLinks().size()); assertEquals(link, provider.getLinks().get(0)); }