public long computeMemorySize(double fraction) {
        validateFraction(fraction);

        return (long) Math.floor(memoryBudget.getTotalMemorySize() * fraction);
    }
@Test
    void testComputeMemorySize() {
        double fraction = 0.6;
        assertThat(memoryManager.computeMemorySize(fraction))
                .isEqualTo((long) (memoryManager.getMemorySize() * fraction));

        fraction = 1.0;
        assertThat(memoryManager.computeMemorySize(fraction))
                .isEqualTo((long) (memoryManager.getMemorySize() * fraction));
    }