2828 * Based on https://github.com/google/farmhash/blob/34c13ddfab0e35422f4c3979f360635a8c050260/src/farmhash.cc
2929 */
3030public class OriginalFarmHashTest {
31- static final int kDataSize = 1 << 20 ;
32- static final int kTestSize = 300 ;
33- static final byte [] data = new byte [kDataSize ];
31+ private static final int kDataSize = 1 << 20 ;
32+ private static final int kTestSize = 300 ;
33+ private static final byte [] data = new byte [kDataSize ];
3434 static {
3535 long a = 9 ;
3636 long b = 777 ;
@@ -44,9 +44,9 @@ public class OriginalFarmHashTest {
4444 }
4545 }
4646
47- static final int c1 = 0xcc9e2d51 ;
47+ private static final int c1 = 0xcc9e2d51 ;
4848
49- static long createSeed (int offset , int salt ) {
49+ private static long createSeed (int offset , int salt ) {
5050 int h = salt ;
5151 h = h * c1 ;
5252 h ^= (h >>> 17 );
@@ -64,15 +64,15 @@ static long createSeed(int offset, int salt) {
6464 return h & 0xFFFFFFFFL ;
6565 }
6666
67- static long SEED (int offset ) {
67+ private static long SEED (int offset ) {
6868 return createSeed (offset , -1 );
6969 }
7070
71- static long SEED0 (int offset ) {
71+ private static long SEED0 (int offset ) {
7272 return createSeed (offset , 0 );
7373 }
7474
75- static long SEED1 (int offset ) {
75+ private static long SEED1 (int offset ) {
7676 return createSeed (offset , 1 );
7777 }
7878
@@ -88,7 +88,7 @@ public void testNa() {
8888 testNa (0 , kDataSize , expectedIndex );
8989 }
9090
91- static int testNa (int offset , int len , int expectedIndex ) {
91+ private static int testNa (int offset , int len , int expectedIndex ) {
9292 LongHashFunction f = LongHashFunction .farmNa (SEED0 (offset ), SEED1 (offset ));
9393 long h = f .hashBytes (data , offset , len );
9494 assertEquals (NA_EXPECTED [expectedIndex ++], h >>> 32 );
@@ -119,7 +119,7 @@ public void testUo() {
119119 testUo (0 , kDataSize , expectedIndex );
120120 }
121121
122- static int testUo (int offset , int len , int expectedIndex ) {
122+ private static int testUo (int offset , int len , int expectedIndex ) {
123123 LongHashFunction f = LongHashFunction .farmUo (SEED (offset ));
124124 long h = f .hashBytes (data , offset , len );
125125 assertEquals (UO_EXPECTED [expectedIndex ++], h >>> 32 );
@@ -146,7 +146,7 @@ public void testUoGo() {
146146 }
147147 }
148148
149- static final Object [][] GOLDEN_64 = {
149+ private static final Object [][] GOLDEN_64 = {
150150 {0xb3454265b6df75e3L , "a" },
151151 {0xaa8d6e5242ada51eL , "ab" },
152152 {0x24a5b3a074e7f369L , "abc" },
@@ -179,7 +179,7 @@ public void testUoGo() {
179179 {0x5a0a6efd52e84e2aL , "How can you write a big system without C++? -Paul Glick" },
180180 };
181181
182- static final long [] NA_EXPECTED = {
182+ private static final long [] NA_EXPECTED = {
183183 1140953930L , 861465670L ,
184184 3277735313L , 2681724312L ,
185185 2598464059L , 797982799L ,
@@ -1268,7 +1268,7 @@ public void testUoGo() {
12681268 4166253320L , 2747410691L ,
12691269 };
12701270
1271- static final long [] UO_EXPECTED = {
1271+ private static final long [] UO_EXPECTED = {
12721272 3277735313L , 2681724312L ,
12731273 2598464059L , 797982799L ,
12741274 2603993599L , 921001710L ,
0 commit comments