Add missing license headers
[openflowplugin.git] / applications / statistics-manager / src / test / java / test / mock / util / TestUtils.java
1 /*
2  * Copyright (c) 2014, 2016 Cisco Systems, Inc. and others.  All rights reserved.
3  *
4  * This program and the accompanying materials are made available under the
5  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6  * and is available at http://www.eclipse.org/legal/epl-v10.html
7  */
8 package test.mock.util;
9
10 import java.util.Random;
11 import java.util.concurrent.atomic.AtomicLong;
12
13 public class TestUtils {
14
15     private static AtomicLong transId = new AtomicLong();
16
17     private static Random rnd = new Random();
18
19     public static long nextLong(long RangeBottom, long rangeTop) {
20         return RangeBottom + ((long)(rnd.nextDouble()*(rangeTop - RangeBottom)));
21     }
22
23     public static long getNewTransactionId() {
24         return transId.incrementAndGet();
25     }
26 }