### Question:
Deployment { public void addLink(Link link) { if(links==null) links = new ArrayList<Link>(); links.add(link); }  @Id @GeneratedValue(strategy=GenerationType.IDENTITY) @Column(name = "deployment_id", unique = true, nullable = false) int getId(); void setId(int id); @Column(name = "deploymentName", nullable = true, unique = true) String getDeploymentName(); void setDeploymentName(String deploymentName); @Column(name = "provider_id", nullable = true, unique = true) String getProviderId(); void setProviderId(String providerId); @Column(name = "status", nullable = false) String getStatus(); void setStatus(String status); @Column(name = "sla_uuid", nullable = true) String getSlaUUID(); void setSlaUUID(String slaUUID); @Transient String getHref(); void setHref(String href); @Column(name = "price", nullable = true) String getPrice(); void setPrice(String price); @Column(name = "price_schema", nullable = true) int getSchema(); void setSchema(int schema); @Transient List<Link> getLinks(); void setLinks(List<Link> links); void addLink(Link link); @Column(name = "ovf", length=900000) String getOvf(); void setOvf(String ovf); @OneToMany(fetch = FetchType.EAGER, cascade = CascadeType.ALL) @JoinColumn(name = "deployment_id", referencedColumnName="deployment_id", nullable = true) List<VM> getVms(); void setVms(List<VM> vms); void addVM(VM vm); @OneToMany(fetch = FetchType.EAGER, cascade = CascadeType.ALL) @JoinColumn(name = "deployment_id", referencedColumnName="deployment_id", nullable = true) List<Agreement> getAgreements(); void setAgreements(List<Agreement> agreements); void addAgreement(Agreement agreement); @Column(name = "start_date", nullable = true) String getStartDate(); void setStartDate(String startDate); @Column(name = "end_date", nullable = true) String getEndDate(); void setEndDate(String endDate); @ManyToOne(fetch=FetchType.EAGER) @JoinColumn(name="application_id") Application getApplication(); void setApplication(Application application);  }### Answer:
@Test public void addLinkTest() { Deployment deployment = new Deployment(); assertEquals(null, deployment.getLinks()); Link link = new Link(); deployment.addLink(link); assertEquals(link, deployment.getLinks().get(0)); }