### Question:
Library { public void addStat(StatInfo defaultStatInfo) { stats.add(new Stat(defaultStatInfo, this)); } protected  Library();   Library(String uuid);  Library(Date dateAdded); String getUuid(); Date getDateAdded(); Set<Stat> getStats(); void addStat(StatInfo defaultStatInfo); @Override int hashCode(); @Override boolean equals(final Object other); @Override String toString();  }### Answer:
@Test public void testAddStat() { Library library = new Library(new Date()); Artist artist = new Artist("George Thorogood"); String songUuid = artist.addSong(new AlbumAndSongInfoBuilder( "Bad to the Bone").withTrackNumber(1).withDiscNumber(1) .withYear(1988).withGenre("Rock").withHasVideo(false) .withRating(100).withAlbumName("Anthology").withAlbumRating(80) .build()); library.addStat(new StatInfoBuilder().withDateAdded(new Date()) .withSkipCount(0).withRating(80).withPlayCount(12) .withSongUuid(songUuid).build()); Song song = artist.getAlbums().iterator().next().getSongs().iterator() .next(); assertEquals("Library should contain stat after stat added.", 1, library.getStats().size()); library.addStat(new StatInfoBuilder().withDateAdded(new Date()) .withDateModified(new Date()).withDateSkipped(new Date()) .withSkipCount(0).withRating(100).withPlayCount(10) .withSongUuid(song.getUuid()).build()); assertEquals( "Library should contain stat after stat added for the same song.", 1, library.getStats().size()); }