### Question:
ValidationResults implements Serializable { public void withCrumb(CrumbInfo crumbInfo, Runnable code) { if (crumbInfo != null) { crumbs.addLast(crumbInfo); } try { code.run(); } finally { if (crumbInfo != null) { crumbs.pollLast(); } } }  void add(ValidationResult result, Object... msgArgs); void add(CrumbInfo crumbInfo, ValidationResult result, Object... msgArgs); void add(ValidationResults results); void add(Collection<CrumbInfo> parentCrumbs, ValidationResults results); void add(Collection<ValidationResults.CrumbInfo> parentCrumbs, Collection<ValidationResults.ValidationItem> resultItems); Collection<CrumbInfo> crumbs(); List<ValidationItem> items(); List<ValidationItem> items(ValidationSeverity severity); ValidationSeverity severity(); void withCrumb(CrumbInfo crumbInfo, Runnable code); boolean isValid(); int size(); @Override String toString();  }### Answer:
@Test public void withCrumb() throws Exception { ValidationResults results = new ValidationResults(); final CountDownLatch latch = new CountDownLatch(1); results.withCrumb(new ValidationResults.CrumbInfo("crumb", false), () -> { assertEquals(1, results.crumbs().size()); assertEquals("crumb", results.crumbs().iterator().next().crumb()); latch.countDown(); }); latch.await(2, TimeUnit.SECONDS); assertEquals(0, results.size()); CountDownLatch latch2 = new CountDownLatch(1); results.withCrumb(new ValidationResults.CrumbInfo(null, false), latch2::countDown); latch2.await(2, TimeUnit.SECONDS); }