LinkedSpecificationItem { public List<TracedLink> getTracedLinks() { final List<TracedLink> tracedLinks = new ArrayList<>(); for (final Entry<LinkStatus, List<LinkedSpecificationItem>> entry : this.links.entrySet()) { for (final LinkedSpecificationItem other : entry.getValue()) { tracedLinks.add(new TracedLink(other, entry.getKey())); } } return tracedLinks; } LinkedSpecificationItem(final SpecificationItem item); SpecificationItemId getId(); String getTitle(); String getTitleWithFallback(); ItemStatus getStatus(); String getDescription(); Location getLocation(); List<String> getTags(); SpecificationItem getItem(); void addLinkToItemWithStatus(final LinkedSpecificationItem item, final LinkStatus status); Map<LinkStatus, List<LinkedSpecificationItem>> getLinks(); List<LinkedSpecificationItem> getLinksByStatus(final LinkStatus status); List<TracedLink> getTracedLinks(); List<SpecificationItemId> getCoveredIds(); List<String> getNeedsArtifactTypes(); void addCoveredArtifactType(final String artifactType); void addOverCoveredArtifactType(final String artifactType); Set<String> getCoveredArtifactTypes(); Set<String> getOverCoveredArtifactTypes(); List<String> getUncoveredArtifactTypes(); boolean isCoveredShallow(); DeepCoverageStatus getDeepCoverageStatus(); boolean isDefect(); boolean hasLinks(); int countOutgoingLinks(); int countOutgoingBadLinks(); int countIncomingLinks(); int countIncomingBadLinks(); int countDuplicateLinks(); boolean hasDuplicates(); String getArtifactType(); String getName(); int getRevision();  }
@Test void testGetTracedLinks() { this.linkedItem.addLinkToItemWithStatus(this.coveredLinkedItem, LinkStatus.COVERS); this.linkedItem.addLinkToItemWithStatus(this.linkedItem, LinkStatus.ORPHANED); final List<TracedLink> links = this.linkedItem.getTracedLinks(); final TracedLink expectedLinkA = new TracedLink(this.linkedItem, LinkStatus.ORPHANED); final TracedLink expectedLinkB = new TracedLink(this.coveredLinkedItem, LinkStatus.COVERS); assertThat(links, containsInAnyOrder(expectedLinkA, expectedLinkB)); }