An obvious 'fix' would be to copy paste the logic, but this is not a good practice. I normally pull out methods for calculations. I would pull out the whole switch/case block probably in a method which calculates the evictSize and create additional calc methods for each of the maxSizePolicies.

And then you could even ask yourself the question: why is a max size and int instead of enum and why don't we move the calculation to the enumeration so the enumeration is responsible for calculating so you can rely on polymorphism.