void (@NotNull MemoryAgentActionResult<Pair<long[], ObjectReference[]>> result, @NotNull RetainedSizeDialog dialog) { if (result.executedSuccessfully()) { Pair<long[], ObjectReference[]> sizesAndHeldObjects = result.getResult(); long[] sizes = sizesAndHeldObjects.getFirst(); dialog.setHeldObjectsAndSizes( Arrays.asList(sizesAndHeldObjects.getSecond()), sizes[0], sizes[1] ); } else { dialog.setCalculationTimeoutMessage(); } }