@Test public void testDiscardSubTrace() { Tracer tracer = new Tracer(); tracer.newSubTrace(); tracer.setTraceElement(E1); tracer.newSubTrace(); tracer.setTraceElement(E2); tracer.discardSubTrace(); tracer.endSubTrace(); List<TraceTree> trace = tracer.getTrace(); assertThat(trace, contains(allOf(hasTraceElement(E1), hasChildren(empty())))); }
public void discardSubTrace() { checkState(!_stack.isEmpty(), "no trace in progress"); _stack.pop(); }
Tracer { public void discardSubTrace() { checkState(!_stack.isEmpty(), "no trace in progress"); _stack.pop(); } }
Tracer { public void discardSubTrace() { checkState(!_stack.isEmpty(), "no trace in progress"); _stack.pop(); } Tracer(); }
Tracer { public void discardSubTrace() { checkState(!_stack.isEmpty(), "no trace in progress"); _stack.pop(); } Tracer(); List<TraceTree> getTrace(); void setTraceElement(@Nonnull TraceElement traceElement); void newSubTrace(); void endSubTrace(); void discardSubTrace(); }
Tracer { public void discardSubTrace() { checkState(!_stack.isEmpty(), "no trace in progress"); _stack.pop(); } Tracer(); List<TraceTree> getTrace(); void setTraceElement(@Nonnull TraceElement traceElement); void newSubTrace(); void endSubTrace(); void discardSubTrace();  }