Pair<Boolean, Long> pair = new Pair<Boolean, Long>(true, t.getDurationInMicros());
List<Message> children = t.getChildren();
int size = children.size();
if (tree.getMessage() == t && size > 0) { // root transaction with children
Message last = children.get(size - 1);
if (last instanceof Event) {
String type = last.getType();
String name = last.getName();
if (type.equals("RemoteCall") && name.equals("Next")) {
pair.setKey(false);
} else if (type.equals("TruncatedTransaction") && name.equals("TotalDuration")) {
try {
long delta = Long.parseLong(last.getData().toString());
pair.setValue(delta);
} catch (Exception e) {
Cat.logError(e);
}