### Question:
Application { public void addImage(Image image) { if(images==null) images = new ArrayList<Image>(); images.add(image); }  @Id @GeneratedValue(strategy=GenerationType.IDENTITY) @Column(name = "application_id", unique = true, nullable = false) int getId(); void setId(int id); @Column(name = "name", nullable = false) String getName(); void setName(String name); @Transient List<Link> getLinks(); void setLinks(List<Link> links); void addLink(Link link); @OneToMany(fetch = FetchType.LAZY, cascade = CascadeType.ALL) @JoinColumn(name = "application_id", referencedColumnName="application_id", nullable = true) List<Image> getImages(); void setImages(List<Image> images); void addImage(Image image); @OneToMany(fetch = FetchType.LAZY, cascade = CascadeType.ALL) @JoinColumn(name = "application_id", referencedColumnName="application_id", nullable = true) List<Deployment> getDeployments(); void setDeployments(List<Deployment> deployments); void addDeployment(Deployment deployment); @Transient String getHref(); void setHref(String href);  }### Answer:
@Test public void addImageTest() { Application application = new Application(); assertEquals(null, application.getImages()); Image image = new Image(); application.addImage(image); assertEquals(1, application.getImages().size()); assertEquals(image, application.getImages().get(0)); }