Here you can find the source of getAndResetInvocationCount()
public static int getAndResetInvocationCount()
//package com.java2s; /*// www.j a v a 2 s . co m * Hibernate, Relational Persistence for Idiomatic Java * * License: GNU Lesser General Public License (LGPL), version 2.1 or later. * See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>. */ import java.util.concurrent.atomic.AtomicInteger; public class Main { public static final AtomicInteger COUNTER = new AtomicInteger(); public static int getAndResetInvocationCount() { return COUNTER.getAndSet(0); } }