Instead of doing this every time, can you add another method in Granularity.granularitiesToRoll()? Either way seems not good but checking this everytime in the forloop seems not performant.