Looks a little bit neatly, doesn’t it? Importantly, the re-written code doesn’t have a potential problem with the memory usage. Can you imagine to retrieve a few millions of entities just in order to call the size() method?