Trace { public long endTime() { return getTimestamp() + calculateDuration(); } Trace(); String getTraceId(); Trace setTraceId(String traceId); String getFragmentId(); Trace setFragmentId(String fragmentId); long getTimestamp(); Trace setTimestamp(long timestamp); String getTransaction(); Trace setTransaction(String name); String getHostName(); Trace setHostName(String hostName); String getHostAddress(); Trace setHostAddress(String hostAddress); List<Node> getNodes(); Trace setNodes(List<Node> nodes); Set<Property> allProperties(); boolean hasProperty(String name); Set<Property> getProperties(String name); boolean initialFragment(); long endTime(); long calculateDuration(); Set<Node> getCorrelatedNodes(CorrelationIdentifier cid); @Override int hashCode(); @Override boolean equals(Object obj); @Override String toString();  }
@Test public void testEndTime() { Trace trace = new Trace(); trace.setTimestamp(100000); Consumer node1 = new Consumer(); node1.setTimestamp(100000); trace.getNodes().add(node1); Component node2 = new Component(); node2.setTimestamp(150000); node2.setDuration(0); node1.getNodes().add(node2); Producer node3 = new Producer(); node3.setTimestamp(200000); node3.setDuration(50000); node1.getNodes().add(node3); assertEquals(250000, trace.endTime()); }