Trace { public Set<Property> allProperties() { Set<Property> properties = new HashSet<Property>(); for (Node n : nodes) { n.includeProperties(properties); } return Collections.unmodifiableSet(properties); } 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 testAllProperties() { Trace trace1 = new Trace(); trace1.setFragmentId("1"); trace1.setTransaction("testapp"); Consumer c1 = new Consumer(); c1.getProperties().add(new Property("prop1", "value1")); trace1.getNodes().add(c1); Producer p1 = new Producer(); p1.getProperties().add(new Property("prop2", "value2")); c1.getNodes().add(p1); Component ct1 = new Component(); ct1.getProperties().add(new Property("prop3", "value3")); c1.getNodes().add(ct1); assertEquals(3, trace1.allProperties().size()); }