void (Supplier<? extends RangeMarker> creator, Consumer<? super RangeMarker> remover) { RangeMarker marker = creator.get(); assertTrue(marker.isValid()); TextRange range = marker.getTextRange(); remover.accept(marker); assertFalse(marker.isValid()); assertEquals(range, marker.getTextRange()); }