private void addModels ( final Key < Model > [ ] newModels ) { int before = leaderboard ( ) . getModelCount ( ) ; leaderboard ( ) . addModels ( newModels ) ; int after = leaderboard ( ) . getModelCount ( ) ; modelCount . addAndGet ( after - before ) ; }
Also the leaderboard will reject duplicate models so use the difference in Leaderboard length here .