@Test
public void should_return_list_of_distinct_asset_used_by_page_and_widgets() throws Exception {

    Component component = mockComponentFor(
            aWidget(),
            "id1",
            anAsset().withName("myfile.js").withType(AssetType.JAVASCRIPT),
            anAsset().withName("http://mycdn.com/myfile.js").withType(AssetType.JAVASCRIPT)
    );
    Page page = aPage()
            .with(component)
            .withAsset(anAsset().withName("myfile.js").withType(AssetType.JAVASCRIPT).build())
            .build();
    Set<Asset> assets = assetVisitor.visit(page);
    assertThat(assets).extracting("name").contains("myfile.js", "myfile.js", "http://mycdn.com/myfile.js");
    assertThat(assets).extracting("componentId").contains(null, "id1", "id1");
}