It's probably better create a setCurrentFrame method to set this attribute, and do there the range check that is done in the get (if (currentFrame >= 0 && currentFrame < frames.size()) {), and log an error if it's not valid, and let getCurrentFrame just with return frames.get(currentFrame);