Node { protected long completedDuration() { return overallEndTime() - timestamp; } Node(NodeType type);  Node(NodeType type, String uri); boolean containerNode(); boolean interactionNode(); NodeType getType(); Node setType(NodeType type); String getUri(); Node setUri(String uri); String getOperation(); void setOperation(String operation); long getTimestamp(); Node setTimestamp(long timestamp); long getDuration(); Node setDuration(long duration); Set<Property> getProperties(); Node setProperties(Set<Property> properties); boolean hasProperty(String name); Set<Property> getProperties(String name); List<CorrelationIdentifier> getCorrelationIds(); Node setCorrelationIds(List<CorrelationIdentifier> correlationIds); Node addInteractionCorrelationId(String id); Node addControlFlowCorrelationId(String id); Node addCausedByCorrelationId(String id); List<CorrelationIdentifier> findCorrelationIds(Scope... scope); @Override int hashCode(); @Override boolean equals(Object obj);  }
@Test public void testCompletedDuration() { Consumer node1 = new Consumer(); node1.setTimestamp(1000); node1.setDuration(500); Producer node2 = new Producer(); node2.setTimestamp(1200); node2.setDuration(800); node1.getNodes().add(node2); assertEquals(1000, node1.completedDuration()); }