HystrixCollapser implements HystrixExecutable<ResponseType>, HystrixObservable<ResponseType> { public ResponseType execute() { try { return queue().get(); } catch (Throwable e) { if (e instanceof HystrixRuntimeException) { throw (HystrixRuntimeException) e; } if (e.getCause() instanceof HystrixRuntimeException) { throw (HystrixRuntimeException) e.getCause(); } String message = getClass().getSimpleName() + " HystrixCollapser failed while executing."; logger.debug(message, e); throw new RuntimeException(message, e); } } protected  HystrixCollapser(); protected  HystrixCollapser(HystrixCollapserKey collapserKey); protected  HystrixCollapser(Setter setter);   HystrixCollapser(HystrixCollapserKey collapserKey, Scope scope, CollapserTimer timer, HystrixCollapserProperties.Setter propertiesBuilder);   HystrixCollapser(HystrixCollapserKey collapserKey, Scope scope, CollapserTimer timer, HystrixCollapserProperties.Setter propertiesBuilder, HystrixCollapserMetrics metrics); HystrixCollapserKey getCollapserKey(); Scope getScope(); HystrixCollapserMetrics getMetrics(); abstract RequestArgumentType getRequestArgument(); Observable<ResponseType> observe(); Observable<ResponseType> toObservable(); Observable<ResponseType> toObservable(Scheduler observeOn); ResponseType execute(); Future<ResponseType> queue();  }
@Test public void testVoidResponseTypeFireAndForgetCollapsing3() throws Exception { CollapserTimer timer = new RealCollapserTimer(); TestCollapserWithVoidResponseType collapser1 = new TestCollapserWithVoidResponseType(timer, 1); assertNull(collapser1.execute()); assertEquals(1, HystrixRequestLog.getCurrentRequest().getAllExecutedCommands().size()); Iterator<HystrixInvokableInfo<?>> cmdIterator = HystrixRequestLog.getCurrentRequest().getAllExecutedCommands().iterator(); assertEquals(1, cmdIterator.next().getNumberCollapsed()); }