hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From zhang...@apache.org
Subject [20/34] hbase git commit: HBASE-19811 Fix findbugs and error-prone warnings in hbase-server (branch-2)
Date Wed, 24 Jan 2018 09:51:02 GMT
http://git-wip-us.apache.org/repos/asf/hbase/blob/93a182f2/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/MasterProcedureSchedulerPerformanceEvaluation.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/MasterProcedureSchedulerPerformanceEvaluation.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/MasterProcedureSchedulerPerformanceEvaluation.java
index 21d914a..e5d3a79 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/MasterProcedureSchedulerPerformanceEvaluation.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/MasterProcedureSchedulerPerformanceEvaluation.java
@@ -102,6 +102,7 @@ public class MasterProcedureSchedulerPerformanceEvaluation extends AbstractHBase
       this.hri = hri;
     }
 
+    @Override
     public Procedure newProcedure(long procId) {
       return new RegionProcedure(procId, hri);
     }
@@ -132,6 +133,7 @@ public class MasterProcedureSchedulerPerformanceEvaluation extends AbstractHBase
       this.tableName = tableName;
     }
 
+    @Override
     public Procedure newProcedure(long procId) {
       return new TableProcedure(procId, tableName);
     }
@@ -196,6 +198,7 @@ public class MasterProcedureSchedulerPerformanceEvaluation extends AbstractHBase
   private final AtomicLong completed = new AtomicLong(0);
 
   private class AddProcsWorker extends Thread {
+    @Override
     public void run() {
       final Random rand = new Random(System.currentTimeMillis());
       long procId = procIds.incrementAndGet();
@@ -209,6 +212,7 @@ public class MasterProcedureSchedulerPerformanceEvaluation extends AbstractHBase
   }
 
   private class PollAndLockWorker extends Thread {
+    @Override
     public void run() {
       while (completed.get() < numOps) {
         // With lock/unlock being ~100ns, and no other workload, 1000ns wait seams reasonable.

http://git-wip-us.apache.org/repos/asf/hbase/blob/93a182f2/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestModifyNamespaceProcedure.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestModifyNamespaceProcedure.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestModifyNamespaceProcedure.java
index 8dec59d..4adab53 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestModifyNamespaceProcedure.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestModifyNamespaceProcedure.java
@@ -99,7 +99,7 @@ public class TestModifyNamespaceProcedure {
     // Before modify
     NamespaceDescriptor currentNsDescriptor =
         UTIL.getAdmin().getNamespaceDescriptor(nsd.getName());
-    assertEquals(currentNsDescriptor.getConfigurationValue(nsKey1), nsValue1before);
+    assertEquals(nsValue1before, currentNsDescriptor.getConfigurationValue(nsKey1));
     assertNull(currentNsDescriptor.getConfigurationValue(nsKey2));
 
     // Update
@@ -115,8 +115,8 @@ public class TestModifyNamespaceProcedure {
     // Verify the namespace is updated.
     currentNsDescriptor =
         UTIL.getAdmin().getNamespaceDescriptor(nsd.getName());
-    assertEquals(nsd.getConfigurationValue(nsKey1), nsValue1after);
-    assertEquals(currentNsDescriptor.getConfigurationValue(nsKey2), nsValue2);
+    assertEquals(nsValue1after, nsd.getConfigurationValue(nsKey1));
+    assertEquals(nsValue2, currentNsDescriptor.getConfigurationValue(nsKey2));
   }
 
   @Test(timeout=60000)
@@ -219,7 +219,7 @@ public class TestModifyNamespaceProcedure {
     // Validate
     NamespaceDescriptor currentNsDescriptor =
         UTIL.getAdmin().getNamespaceDescriptor(nsd.getName());
-    assertEquals(currentNsDescriptor.getConfigurationValue(nsKey), nsValue);
+    assertEquals(nsValue, currentNsDescriptor.getConfigurationValue(nsKey));
   }
 
   @Test(timeout = 60000)

http://git-wip-us.apache.org/repos/asf/hbase/blob/93a182f2/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestModifyTableProcedure.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestModifyTableProcedure.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestModifyTableProcedure.java
index 8b58646..24a6bc5 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestModifyTableProcedure.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestModifyTableProcedure.java
@@ -33,6 +33,7 @@ import org.apache.hadoop.hbase.procedure2.ProcedureExecutor;
 import org.apache.hadoop.hbase.procedure2.ProcedureTestingUtility;
 import org.apache.hadoop.hbase.testclassification.MasterTests;
 import org.apache.hadoop.hbase.testclassification.MediumTests;
+import org.apache.hadoop.hbase.util.Bytes;
 import org.junit.Rule;
 import org.junit.Test;
 import org.junit.experimental.categories.Category;
@@ -103,7 +104,7 @@ public class TestModifyTableProcedure extends TestTableDDLProcedureBase {
 
     currentHtd = UTIL.getAdmin().getTableDescriptor(tableName);
     assertEquals(2, currentHtd.getFamiliesKeys().size());
-    assertTrue(currentHtd.hasFamily(cf2.getBytes()));
+    assertTrue(currentHtd.hasFamily(Bytes.toBytes(cf2)));
 
     // Test 2: Modify the table descriptor offline
     UTIL.getAdmin().disableTable(tableName);
@@ -119,7 +120,7 @@ public class TestModifyTableProcedure extends TestTableDDLProcedureBase {
     ProcedureTestingUtility.assertProcNotFailed(procExec.getResult(procId2));
 
     currentHtd = UTIL.getAdmin().getTableDescriptor(tableName);
-    assertTrue(currentHtd.hasFamily(cf3.getBytes()));
+    assertTrue(currentHtd.hasFamily(Bytes.toBytes(cf3)));
     assertEquals(3, currentHtd.getFamiliesKeys().size());
   }
 
@@ -137,7 +138,7 @@ public class TestModifyTableProcedure extends TestTableDDLProcedureBase {
 
     // Test 1: Modify the table descriptor
     HTableDescriptor htd = new HTableDescriptor(UTIL.getAdmin().getTableDescriptor(tableName));
-    htd.removeFamily(cf2.getBytes());
+    htd.removeFamily(Bytes.toBytes(cf2));
 
     long procId = ProcedureTestingUtility.submitAndWait(
         procExec, new ModifyTableProcedure(procExec.getEnvironment(), htd));
@@ -145,7 +146,7 @@ public class TestModifyTableProcedure extends TestTableDDLProcedureBase {
 
     currentHtd = UTIL.getAdmin().getTableDescriptor(tableName);
     assertEquals(2, currentHtd.getFamiliesKeys().size());
-    assertFalse(currentHtd.hasFamily(cf2.getBytes()));
+    assertFalse(currentHtd.hasFamily(Bytes.toBytes(cf2)));
 
     // Test 2: Modify the table descriptor offline
     UTIL.getAdmin().disableTable(tableName);
@@ -153,7 +154,7 @@ public class TestModifyTableProcedure extends TestTableDDLProcedureBase {
 
     HTableDescriptor htd2 =
         new HTableDescriptor(UTIL.getAdmin().getTableDescriptor(tableName));
-    htd2.removeFamily(cf3.getBytes());
+    htd2.removeFamily(Bytes.toBytes(cf3));
     // Disable Sanity check
     htd2.setConfiguration("hbase.table.sanity.checks", Boolean.FALSE.toString());
 
@@ -164,12 +165,12 @@ public class TestModifyTableProcedure extends TestTableDDLProcedureBase {
 
     currentHtd = UTIL.getAdmin().getTableDescriptor(tableName);
     assertEquals(1, currentHtd.getFamiliesKeys().size());
-    assertFalse(currentHtd.hasFamily(cf3.getBytes()));
+    assertFalse(currentHtd.hasFamily(Bytes.toBytes(cf3)));
 
     //Removing the last family will fail
     HTableDescriptor htd3 =
         new HTableDescriptor(UTIL.getAdmin().getTableDescriptor(tableName));
-    htd3.removeFamily(cf1.getBytes());
+    htd3.removeFamily(Bytes.toBytes(cf1));
     long procId3 =
         ProcedureTestingUtility.submitAndWait(procExec,
             new ModifyTableProcedure(procExec.getEnvironment(), htd3));
@@ -179,7 +180,7 @@ public class TestModifyTableProcedure extends TestTableDDLProcedureBase {
     assertTrue("expected DoNotRetryIOException, got " + cause,
         cause instanceof DoNotRetryIOException);
     assertEquals(1, currentHtd.getFamiliesKeys().size());
-    assertTrue(currentHtd.hasFamily(cf1.getBytes()));
+    assertTrue(currentHtd.hasFamily(Bytes.toBytes(cf1)));
   }
 
   @Test(timeout=60000)
@@ -202,7 +203,7 @@ public class TestModifyTableProcedure extends TestTableDDLProcedureBase {
     boolean newCompactionEnableOption = htd.isCompactionEnabled() ? false : true;
     htd.setCompactionEnabled(newCompactionEnableOption);
     htd.addFamily(new HColumnDescriptor(cf2));
-    htd.removeFamily(cf3.getBytes());
+    htd.removeFamily(Bytes.toBytes(cf3));
     htd.setRegionReplication(3);
 
     // Start the Modify procedure && kill the executor
@@ -240,7 +241,7 @@ public class TestModifyTableProcedure extends TestTableDDLProcedureBase {
     boolean newCompactionEnableOption = htd.isCompactionEnabled() ? false : true;
     htd.setCompactionEnabled(newCompactionEnableOption);
     htd.addFamily(new HColumnDescriptor(cf2));
-    htd.removeFamily(cf3.getBytes());
+    htd.removeFamily(Bytes.toBytes(cf3));
 
     // Start the Modify procedure && kill the executor
     long procId = procExec.submitProcedure(
@@ -253,8 +254,8 @@ public class TestModifyTableProcedure extends TestTableDDLProcedureBase {
     HTableDescriptor currentHtd = UTIL.getAdmin().getTableDescriptor(tableName);
     assertEquals(newCompactionEnableOption, currentHtd.isCompactionEnabled());
     assertEquals(2, currentHtd.getFamiliesKeys().size());
-    assertTrue(currentHtd.hasFamily(cf2.getBytes()));
-    assertFalse(currentHtd.hasFamily(cf3.getBytes()));
+    assertTrue(currentHtd.hasFamily(Bytes.toBytes(cf2)));
+    assertFalse(currentHtd.hasFamily(Bytes.toBytes(cf3)));
 
     // cf2 should be added cf3 should be removed
     MasterProcedureTestingUtility.validateTableCreation(UTIL.getHBaseCluster().getMaster(),

http://git-wip-us.apache.org/repos/asf/hbase/blob/93a182f2/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestWALProcedureStoreOnHDFS.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestWALProcedureStoreOnHDFS.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestWALProcedureStoreOnHDFS.java
index 2834b8f..2140d5e 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestWALProcedureStoreOnHDFS.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/procedure/TestWALProcedureStoreOnHDFS.java
@@ -135,7 +135,7 @@ public class TestWALProcedureStoreOnHDFS {
     final AtomicInteger reCount = new AtomicInteger(0);
     Thread[] thread = new Thread[store.getNumThreads() * 2 + 1];
     for (int i = 0; i < thread.length; ++i) {
-      final long procId = i + 1;
+      final long procId = i + 1L;
       thread[i] = new Thread(() -> {
         try {
           LOG.debug("[S] INSERT " + procId);

http://git-wip-us.apache.org/repos/asf/hbase/blob/93a182f2/hbase-server/src/test/java/org/apache/hadoop/hbase/master/snapshot/TestSnapshotFileCache.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/snapshot/TestSnapshotFileCache.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/snapshot/TestSnapshotFileCache.java
index e2f326e..21a3753 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/snapshot/TestSnapshotFileCache.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/snapshot/TestSnapshotFileCache.java
@@ -203,6 +203,7 @@ public class TestSnapshotFileCache {
   }
 
   class SnapshotFiles implements SnapshotFileCache.SnapshotFileInspector {
+    @Override
     public Collection<String> filesUnderSnapshot(final Path snapshotDir) throws IOException {
       Collection<String> files =  new HashSet<>();
       files.addAll(SnapshotReferenceUtil.getHFileNames(UTIL.getConfiguration(), fs, snapshotDir));

http://git-wip-us.apache.org/repos/asf/hbase/blob/93a182f2/hbase-server/src/test/java/org/apache/hadoop/hbase/master/snapshot/TestSnapshotHFileCleaner.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/snapshot/TestSnapshotHFileCleaner.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/snapshot/TestSnapshotHFileCleaner.java
index ad6c58e..8f81946 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/snapshot/TestSnapshotHFileCleaner.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/snapshot/TestSnapshotHFileCleaner.java
@@ -114,7 +114,8 @@ public class TestSnapshotHFileCleaner {
     assertFalse(cleaner.isFileDeletable(fs.getFileStatus(refFile)));
   }
 
-  class SnapshotFiles implements SnapshotFileCache.SnapshotFileInspector {
+  static class SnapshotFiles implements SnapshotFileCache.SnapshotFileInspector {
+    @Override
     public Collection<String> filesUnderSnapshot(final Path snapshotDir) throws IOException {
       Collection<String> files =  new HashSet<>();
       files.addAll(SnapshotReferenceUtil.getHFileNames(TEST_UTIL.getConfiguration(), fs, snapshotDir));

http://git-wip-us.apache.org/repos/asf/hbase/blob/93a182f2/hbase-server/src/test/java/org/apache/hadoop/hbase/mob/TestCachedMobFile.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/mob/TestCachedMobFile.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/mob/TestCachedMobFile.java
index 32e6522..65f50c9 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/mob/TestCachedMobFile.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/mob/TestCachedMobFile.java
@@ -18,7 +18,7 @@
  */
 package org.apache.hadoop.hbase.mob;
 
-import junit.framework.TestCase;
+import static org.junit.Assert.assertEquals;
 
 import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.fs.FileSystem;
@@ -34,13 +34,15 @@ import org.apache.hadoop.hbase.regionserver.StoreFileWriter;
 import org.apache.hadoop.hbase.testclassification.SmallTests;
 import org.apache.hadoop.hbase.util.Bytes;
 import org.junit.Assert;
+import org.junit.Rule;
 import org.junit.Test;
 import org.junit.experimental.categories.Category;
+import org.junit.rules.TestName;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 @Category(SmallTests.class)
-public class TestCachedMobFile extends TestCase{
+public class TestCachedMobFile {
   static final Logger LOG = LoggerFactory.getLogger(TestCachedMobFile.class);
   private static final HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility();
   private Configuration conf = TEST_UTIL.getConfiguration();
@@ -50,10 +52,12 @@ public class TestCachedMobFile extends TestCase{
   private static final long EXPECTED_REFERENCE_ZERO = 0;
   private static final long EXPECTED_REFERENCE_ONE = 1;
   private static final long EXPECTED_REFERENCE_TWO = 2;
+  @Rule
+  public TestName testName = new TestName();
 
   @Test
   public void testOpenClose() throws Exception {
-    String caseName = getName();
+    String caseName = testName.getMethodName();
     Path testDir = TEST_UTIL.getDataTestDir();
     FileSystem fs = testDir.getFileSystem(conf);
     HFileContext meta = new HFileContextBuilder().withBlockSize(8*1024).build();
@@ -61,21 +65,21 @@ public class TestCachedMobFile extends TestCase{
         .withOutputDir(testDir).withFileContext(meta).build();
     MobTestUtil.writeStoreFile(writer, caseName);
     CachedMobFile cachedMobFile = CachedMobFile.create(fs, writer.getPath(), conf, cacheConf);
-    Assert.assertEquals(EXPECTED_REFERENCE_ZERO, cachedMobFile.getReferenceCount());
+    assertEquals(EXPECTED_REFERENCE_ZERO, cachedMobFile.getReferenceCount());
     cachedMobFile.open();
-    Assert.assertEquals(EXPECTED_REFERENCE_ONE, cachedMobFile.getReferenceCount());
+    assertEquals(EXPECTED_REFERENCE_ONE, cachedMobFile.getReferenceCount());
     cachedMobFile.open();
-    Assert.assertEquals(EXPECTED_REFERENCE_TWO, cachedMobFile.getReferenceCount());
+    assertEquals(EXPECTED_REFERENCE_TWO, cachedMobFile.getReferenceCount());
     cachedMobFile.close();
-    Assert.assertEquals(EXPECTED_REFERENCE_ONE, cachedMobFile.getReferenceCount());
+    assertEquals(EXPECTED_REFERENCE_ONE, cachedMobFile.getReferenceCount());
     cachedMobFile.close();
-    Assert.assertEquals(EXPECTED_REFERENCE_ZERO, cachedMobFile.getReferenceCount());
+    assertEquals(EXPECTED_REFERENCE_ZERO, cachedMobFile.getReferenceCount());
   }
 
   @SuppressWarnings("SelfComparison")
   @Test
   public void testCompare() throws Exception {
-    String caseName = getName();
+    String caseName = testName.getMethodName();
     Path testDir = TEST_UTIL.getDataTestDir();
     FileSystem fs = testDir.getFileSystem(conf);
     Path outputDir1 = new Path(testDir, FAMILY1);
@@ -86,16 +90,16 @@ public class TestCachedMobFile extends TestCase{
     CachedMobFile cachedMobFile1 = CachedMobFile.create(fs, writer1.getPath(), conf, cacheConf);
     Path outputDir2 = new Path(testDir, FAMILY2);
     StoreFileWriter writer2 = new StoreFileWriter.Builder(conf, cacheConf, fs)
-    .withOutputDir(outputDir2)
-    .withFileContext(meta)
-    .build();
+        .withOutputDir(outputDir2)
+        .withFileContext(meta)
+        .build();
     MobTestUtil.writeStoreFile(writer2, caseName);
     CachedMobFile cachedMobFile2 = CachedMobFile.create(fs, writer2.getPath(), conf, cacheConf);
     cachedMobFile1.access(1);
     cachedMobFile2.access(2);
-    Assert.assertEquals(cachedMobFile1.compareTo(cachedMobFile2), 1);
-    Assert.assertEquals(cachedMobFile2.compareTo(cachedMobFile1), -1);
-    Assert.assertEquals(cachedMobFile1.compareTo(cachedMobFile1), 0);
+    assertEquals(1, cachedMobFile1.compareTo(cachedMobFile2));
+    assertEquals(-1, cachedMobFile2.compareTo(cachedMobFile1));
+    assertEquals(0, cachedMobFile1.compareTo(cachedMobFile1));
   }
 
   @Test
@@ -105,7 +109,7 @@ public class TestCachedMobFile extends TestCase{
     HFileContext meta = new HFileContextBuilder().withBlockSize(8 * 1024).build();
     StoreFileWriter writer = new StoreFileWriter.Builder(conf, cacheConf, fs)
         .withOutputDir(testDir).withFileContext(meta).build();
-    String caseName = getName();
+    String caseName = testName.getMethodName();
     MobTestUtil.writeStoreFile(writer, caseName);
     CachedMobFile cachedMobFile = CachedMobFile.create(fs, writer.getPath(), conf, cacheConf);
     byte[] family = Bytes.toBytes(caseName);

http://git-wip-us.apache.org/repos/asf/hbase/blob/93a182f2/hbase-server/src/test/java/org/apache/hadoop/hbase/mob/TestMobFile.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/mob/TestMobFile.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/mob/TestMobFile.java
index f894fb2..cc2aa5c 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/mob/TestMobFile.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/mob/TestMobFile.java
@@ -18,7 +18,9 @@
  */
 package org.apache.hadoop.hbase.mob;
 
-import junit.framework.TestCase;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
 
 import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.fs.FileSystem;
@@ -36,17 +38,21 @@ import org.apache.hadoop.hbase.regionserver.StoreFileScanner;
 import org.apache.hadoop.hbase.regionserver.StoreFileWriter;
 import org.apache.hadoop.hbase.testclassification.SmallTests;
 import org.apache.hadoop.hbase.util.Bytes;
+import org.junit.Rule;
 import org.junit.Test;
 import org.junit.experimental.categories.Category;
+import org.junit.rules.TestName;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 @Category(SmallTests.class)
-public class TestMobFile extends TestCase {
+public class TestMobFile {
   static final Logger LOG = LoggerFactory.getLogger(TestMobFile.class);
   private static final HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility();
   private Configuration conf = TEST_UTIL.getConfiguration();
   private CacheConfig cacheConf =  new CacheConfig(conf);
+  @Rule
+  public TestName testName = new TestName();
 
   @Test
   public void testReadKeyValue() throws Exception {
@@ -57,7 +63,7 @@ public class TestMobFile extends TestCase {
             .withOutputDir(testDir)
             .withFileContext(meta)
             .build();
-    String caseName = getName();
+    String caseName = testName.getMethodName();
     MobTestUtil.writeStoreFile(writer, caseName);
 
     MobFile mobFile =
@@ -110,7 +116,7 @@ public class TestMobFile extends TestCase {
             .withOutputDir(testDir)
             .withFileContext(meta)
             .build();
-    MobTestUtil.writeStoreFile(writer, getName());
+    MobTestUtil.writeStoreFile(writer, testName.getMethodName());
 
     MobFile mobFile =
         new MobFile(new HStoreFile(fs, writer.getPath(), conf, cacheConf, BloomType.NONE, true));

http://git-wip-us.apache.org/repos/asf/hbase/blob/93a182f2/hbase-server/src/test/java/org/apache/hadoop/hbase/mob/TestMobFileCache.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/mob/TestMobFileCache.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/mob/TestMobFileCache.java
index 42e6528..5077728 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/mob/TestMobFileCache.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/mob/TestMobFileCache.java
@@ -18,11 +18,12 @@
  */
 package org.apache.hadoop.hbase.mob;
 
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+
 import java.io.IOException;
 import java.util.Date;
 
-import junit.framework.TestCase;
-
 import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.fs.FileSystem;
 import org.apache.hadoop.fs.Path;
@@ -38,13 +39,15 @@ import org.apache.hadoop.hbase.regionserver.HRegion;
 import org.apache.hadoop.hbase.regionserver.StoreFileWriter;
 import org.apache.hadoop.hbase.testclassification.SmallTests;
 import org.apache.hadoop.hbase.util.Bytes;
+import org.junit.After;
+import org.junit.Before;
 import org.junit.Test;
 import org.junit.experimental.categories.Category;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 @Category(SmallTests.class)
-public class TestMobFileCache extends TestCase {
+public class TestMobFileCache {
   static final Logger LOG = LoggerFactory.getLogger(TestMobFileCache.class);
   private HBaseTestingUtility UTIL;
   private HRegion region;
@@ -73,7 +76,7 @@ public class TestMobFileCache extends TestCase {
   private static final byte[] QF2 = Bytes.toBytes("qf2");
   private static final byte[] QF3 = Bytes.toBytes("qf3");
 
-  @Override
+  @Before
   public void setUp() throws Exception {
     UTIL = HBaseTestingUtility.createLocalHTU();
     conf = UTIL.getConfiguration();
@@ -93,8 +96,8 @@ public class TestMobFileCache extends TestCase {
     region = UTIL.createLocalHRegion(htd, null, null);
   }
 
-  @Override
-  protected void tearDown() throws Exception {
+  @After
+  public void tearDown() throws Exception {
     region.close();
     region.getFilesystem().delete(UTIL.getDataTestDir(), true);
   }

http://git-wip-us.apache.org/repos/asf/hbase/blob/93a182f2/hbase-server/src/test/java/org/apache/hadoop/hbase/mob/TestMobFileName.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/mob/TestMobFileName.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/mob/TestMobFileName.java
index 8478e20..5ca73a6 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/mob/TestMobFileName.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/mob/TestMobFileName.java
@@ -18,26 +18,31 @@
  */
 package org.apache.hadoop.hbase.mob;
 
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotSame;
+import static org.junit.Assert.assertTrue;
+
 import java.util.Date;
 import java.util.Random;
 import java.util.UUID;
 
-import junit.framework.TestCase;
-
 import org.apache.hadoop.hbase.testclassification.SmallTests;
 import org.apache.hadoop.hbase.util.Bytes;
 import org.apache.hadoop.hbase.util.MD5Hash;
+import org.junit.Before;
 import org.junit.Test;
 import org.junit.experimental.categories.Category;
 
 @Category(SmallTests.class)
-public class TestMobFileName extends TestCase {
+public class TestMobFileName {
 
   private String uuid;
   private Date date;
   private String dateStr;
   private byte[] startKey;
 
+  @Before
   public void setUp() {
     Random random = new Random();
     uuid = UUID.randomUUID().toString().replaceAll("-", "");

http://git-wip-us.apache.org/repos/asf/hbase/blob/93a182f2/hbase-server/src/test/java/org/apache/hadoop/hbase/namespace/TestNamespaceAuditor.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/namespace/TestNamespaceAuditor.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/namespace/TestNamespaceAuditor.java
index 94680f2..214fe49 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/namespace/TestNamespaceAuditor.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/namespace/TestNamespaceAuditor.java
@@ -146,7 +146,7 @@ public class TestNamespaceAuditor {
             .addConfiguration(TableNamespaceManager.KEY_MAX_TABLES, "2").build();
     ADMIN.createNamespace(nspDesc);
     assertNotNull("Namespace descriptor found null.", ADMIN.getNamespaceDescriptor(nsp));
-    assertEquals(ADMIN.listNamespaceDescriptors().length, 3);
+    assertEquals(3, ADMIN.listNamespaceDescriptors().length);
     HColumnDescriptor fam1 = new HColumnDescriptor("fam1");
 
     HTableDescriptor tableDescOne =
@@ -592,7 +592,7 @@ public class TestNamespaceAuditor {
             .build();
     ADMIN.createNamespace(nspDesc);
     assertNotNull("Namespace descriptor found null.", ADMIN.getNamespaceDescriptor(nsp));
-    assertEquals(ADMIN.listNamespaceDescriptors().length, 3);
+    assertEquals(3, ADMIN.listNamespaceDescriptors().length);
     HColumnDescriptor fam1 = new HColumnDescriptor("fam1");
     HTableDescriptor tableDescOne =
         new HTableDescriptor(TableName.valueOf(nsp + TableName.NAMESPACE_DELIM + "table1"));

http://git-wip-us.apache.org/repos/asf/hbase/blob/93a182f2/hbase-server/src/test/java/org/apache/hadoop/hbase/procedure/TestProcedure.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/procedure/TestProcedure.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/procedure/TestProcedure.java
index cc48623..b9a4da8 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/procedure/TestProcedure.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/procedure/TestProcedure.java
@@ -52,7 +52,7 @@ public class TestProcedure {
     when(coord.getRpcs()).thenReturn(comms); // make it not null
   }
 
-  class LatchedProcedure extends Procedure {
+  static class LatchedProcedure extends Procedure {
     CountDownLatch startedAcquireBarrier = new CountDownLatch(1);
     CountDownLatch startedDuringBarrier = new CountDownLatch(1);
     CountDownLatch completedProcedure = new CountDownLatch(1);
@@ -93,6 +93,7 @@ public class TestProcedure {
     final LatchedProcedure procspy = spy(proc);
     // coordinator: start the barrier procedure
     new Thread() {
+      @Override
       public void run() {
         procspy.call();
       }
@@ -139,6 +140,7 @@ public class TestProcedure {
     final LatchedProcedure procspy = spy(proc);
     // start the barrier procedure
     new Thread() {
+      @Override
       public void run() {
         procspy.call();
       }
@@ -192,6 +194,7 @@ public class TestProcedure {
 
     // start the barrier procedure
     Thread t = new Thread() {
+      @Override
       public void run() {
         procspy.call();
       }
@@ -214,6 +217,7 @@ public class TestProcedure {
 
     // start the barrier procedure
     Thread t = new Thread() {
+      @Override
       public void run() {
         procspy.call();
       }

http://git-wip-us.apache.org/repos/asf/hbase/blob/93a182f2/hbase-server/src/test/java/org/apache/hadoop/hbase/procedure/TestProcedureCoordinator.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/procedure/TestProcedureCoordinator.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/procedure/TestProcedureCoordinator.java
index 1678a50..e2b1a79 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/procedure/TestProcedureCoordinator.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/procedure/TestProcedureCoordinator.java
@@ -213,6 +213,7 @@ public class TestProcedureCoordinator {
     final Procedure spy = spy(task);
 
     AcquireBarrierAnswer prepare = new AcquireBarrierAnswer(procName, cohort) {
+      @Override
       public void doWork() {
         // then do some fun where we commit before all nodes have prepared
         // "one" commits before anyone else is done
@@ -288,7 +289,7 @@ public class TestProcedureCoordinator {
     inorder.verify(controller).sendGlobalBarrierReached(eq(task), anyListOf(String.class));
   }
 
-  private abstract class OperationAnswer implements Answer<Void> {
+  private static abstract class OperationAnswer implements Answer<Void> {
     private boolean ran = false;
 
     public void ensureRan() {

http://git-wip-us.apache.org/repos/asf/hbase/blob/93a182f2/hbase-server/src/test/java/org/apache/hadoop/hbase/procedure/TestZKProcedure.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/procedure/TestZKProcedure.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/procedure/TestZKProcedure.java
index 1f5cbe6..c139862 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/procedure/TestZKProcedure.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/procedure/TestZKProcedure.java
@@ -244,7 +244,7 @@ public class TestZKProcedure {
             Subprocedure r = ((Subprocedure) invocation.getMock());
             LOG.error("Remote commit failure, not propagating error:" + remoteCause);
             comms.receiveAbortProcedure(r.getName(), remoteCause);
-            assertEquals(r.isComplete(), true);
+            assertEquals(true, r.isComplete());
             // don't complete the error phase until the coordinator has gotten the error
             // notification (which ensures that we never progress past prepare)
             try {

http://git-wip-us.apache.org/repos/asf/hbase/blob/93a182f2/hbase-server/src/test/java/org/apache/hadoop/hbase/quotas/TestQuotaStatusRPCs.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/quotas/TestQuotaStatusRPCs.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/quotas/TestQuotaStatusRPCs.java
index a44ad74..ce0d2f2 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/quotas/TestQuotaStatusRPCs.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/quotas/TestQuotaStatusRPCs.java
@@ -142,7 +142,7 @@ public class TestQuotaStatusRPCs {
     assertTrue(
         "Observed table usage was " + snapshot.getUsage(),
         snapshot.getUsage() >= tableSize);
-    assertEquals(snapshot.getLimit(), sizeLimit);
+    assertEquals(sizeLimit, snapshot.getLimit());
     SpaceQuotaStatus pbStatus = snapshot.getQuotaStatus();
     assertFalse(pbStatus.isInViolation());
   }

http://git-wip-us.apache.org/repos/asf/hbase/blob/93a182f2/hbase-server/src/test/java/org/apache/hadoop/hbase/quotas/TestSuperUserQuotaPermissions.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/quotas/TestSuperUserQuotaPermissions.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/quotas/TestSuperUserQuotaPermissions.java
index 300268f..9ecde78 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/quotas/TestSuperUserQuotaPermissions.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/quotas/TestSuperUserQuotaPermissions.java
@@ -267,6 +267,7 @@ public class TestSuperUserQuotaPermissions {
 
   private <T> T doAsUser(UserGroupInformation ugi, Callable<T> task) throws Exception {
     return ugi.doAs(new PrivilegedExceptionAction<T>() {
+      @Override
       public T run() throws Exception {
         return task.call();
       }

http://git-wip-us.apache.org/repos/asf/hbase/blob/93a182f2/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/EncodedSeekPerformanceTest.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/EncodedSeekPerformanceTest.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/EncodedSeekPerformanceTest.java
index 82e1755..57948b6 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/EncodedSeekPerformanceTest.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/EncodedSeekPerformanceTest.java
@@ -51,7 +51,7 @@ public class EncodedSeekPerformanceTest {
   /** Use this benchmark with default options */
   public EncodedSeekPerformanceTest() {
     configuration.setFloat(HConstants.HFILE_BLOCK_CACHE_SIZE_KEY, 0.5f);
-    randomizer = new Random(42l);
+    randomizer = new Random(42L);
     numberOfSeeks = DEFAULT_NUMBER_OF_SEEKS;
   }
 

http://git-wip-us.apache.org/repos/asf/hbase/blob/93a182f2/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/MockHStoreFile.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/MockHStoreFile.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/MockHStoreFile.java
index e159678..8199b07 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/MockHStoreFile.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/MockHStoreFile.java
@@ -111,11 +111,13 @@ public class MockHStoreFile extends HStoreFile {
     this.entryCount = entryCount;
   }
 
+  @Override
   public OptionalLong getMinimumTimestamp() {
     return timeRangeTracker == null ? OptionalLong.empty()
         : OptionalLong.of(timeRangeTracker.getMin());
   }
 
+  @Override
   public OptionalLong getMaximumTimestamp() {
     return timeRangeTracker == null ? OptionalLong.empty()
         : OptionalLong.of(timeRangeTracker.getMax());

http://git-wip-us.apache.org/repos/asf/hbase/blob/93a182f2/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/StatefulStoreMockMaker.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/StatefulStoreMockMaker.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/StatefulStoreMockMaker.java
index 5af7d96..f89be43 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/StatefulStoreMockMaker.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/StatefulStoreMockMaker.java
@@ -46,6 +46,7 @@ public class StatefulStoreMockMaker {
     return 0;
   }
   private class CancelAnswer implements Answer<Object> {
+    @Override
     public CompactionContext answer(InvocationOnMock invocation) throws Throwable {
       cancelCompaction(invocation.getArgument(0));
       return null;

http://git-wip-us.apache.org/repos/asf/hbase/blob/93a182f2/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestAtomicOperation.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestAtomicOperation.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestAtomicOperation.java
index 774888c..c8a75f0 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestAtomicOperation.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestAtomicOperation.java
@@ -364,9 +364,9 @@ public class TestAtomicOperation {
     assertEquals(0, failures.get());
     Get g = new Get(row);
     Result result = region.get(g);
-    assertEquals(result.getValue(fam1, qual1).length, 10000);
-    assertEquals(result.getValue(fam1, qual2).length, 10000);
-    assertEquals(result.getValue(fam2, qual3).length, 10000);
+    assertEquals(10000, result.getValue(fam1, qual1).length);
+    assertEquals(10000, result.getValue(fam1, qual2).length);
+    assertEquals(10000, result.getValue(fam2, qual3).length);
   }
   /**
    * Test multi-threaded row mutations.

http://git-wip-us.apache.org/repos/asf/hbase/blob/93a182f2/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestBlocksScanned.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestBlocksScanned.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestBlocksScanned.java
index 06cbf7a..a0babe8 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestBlocksScanned.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestBlocksScanned.java
@@ -50,6 +50,7 @@ public class TestBlocksScanned extends HBaseTestCase {
 
   private static HBaseTestingUtility TEST_UTIL = null;
 
+  @Override
   @Before
   public void setUp() throws Exception {
     super.setUp();

http://git-wip-us.apache.org/repos/asf/hbase/blob/93a182f2/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestBulkLoad.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestBulkLoad.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestBulkLoad.java
index 178ea2e..06e7a26 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestBulkLoad.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestBulkLoad.java
@@ -112,6 +112,7 @@ public class TestBulkLoad {
             argThat(bulkLogWalEdit(WALEdit.BULK_LOAD, tableName.toBytes(),
                     familyName, storeFileNames)),
             anyBoolean())).thenAnswer(new Answer() {
+              @Override
               public Object answer(InvocationOnMock invocation) {
                 WALKeyImpl walKey = invocation.getArgument(1);
                 MultiVersionConcurrencyControl mvcc = walKey.getMvcc();
@@ -137,6 +138,7 @@ public class TestBulkLoad {
     when(log.append(any(),
             any(), argThat(bulkLogWalEditType(WALEdit.BULK_LOAD)),
             anyBoolean())).thenAnswer(new Answer() {
+              @Override
               public Object answer(InvocationOnMock invocation) {
                 WALKeyImpl walKey = invocation.getArgument(1);
                 MultiVersionConcurrencyControl mvcc = walKey.getMvcc();
@@ -156,6 +158,7 @@ public class TestBulkLoad {
     when(log.append(any(),
             any(), argThat(bulkLogWalEditType(WALEdit.BULK_LOAD)),
             anyBoolean())).thenAnswer(new Answer() {
+              @Override
               public Object answer(InvocationOnMock invocation) {
                 WALKeyImpl walKey = invocation.getArgument(1);
                 MultiVersionConcurrencyControl mvcc = walKey.getMvcc();
@@ -176,6 +179,7 @@ public class TestBulkLoad {
     when(log.append(any(),
             any(), argThat(bulkLogWalEditType(WALEdit.BULK_LOAD)),
             anyBoolean())).thenAnswer(new Answer() {
+              @Override
               public Object answer(InvocationOnMock invocation) {
                 WALKeyImpl walKey = invocation.getArgument(1);
                 MultiVersionConcurrencyControl mvcc = walKey.getMvcc();
@@ -281,7 +285,7 @@ public class TestBulkLoad {
         writer.append(new KeyValue(CellUtil.createCell(randomBytes,
             family,
             randomBytes,
-            0l,
+            0L,
             KeyValue.Type.Put.getCode(),
             randomBytes)));
       } finally {

http://git-wip-us.apache.org/repos/asf/hbase/blob/93a182f2/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestCellFlatSet.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestCellFlatSet.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestCellFlatSet.java
index 0717b4d..734b930 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestCellFlatSet.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestCellFlatSet.java
@@ -18,25 +18,25 @@
  */
 package org.apache.hadoop.hbase.regionserver;
 
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
 
 import java.lang.management.ManagementFactory;
-
 import java.nio.ByteBuffer;
 import java.util.Iterator;
 import java.util.NavigableMap;
 import java.util.NavigableSet;
 import java.util.SortedSet;
-import junit.framework.TestCase;
+
 import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.hbase.Cell;
 import org.apache.hadoop.hbase.CellComparator;
 import org.apache.hadoop.hbase.CellUtil;
 import org.apache.hadoop.hbase.KeyValue;
 import org.apache.hadoop.hbase.KeyValueUtil;
-
 import org.apache.hadoop.hbase.io.util.MemorySizeUtil;
-
-
 import org.apache.hadoop.hbase.testclassification.RegionServerTests;
 import org.apache.hadoop.hbase.testclassification.SmallTests;
 import org.apache.hadoop.hbase.util.ByteBufferUtils;
@@ -48,11 +48,9 @@ import org.junit.experimental.categories.Category;
 import org.junit.runner.RunWith;
 import org.junit.runners.Parameterized;
 
-import static org.junit.Assert.assertTrue;
-
 @Category({RegionServerTests.class, SmallTests.class})
 @RunWith(Parameterized.class)
-public class TestCellFlatSet extends TestCase {
+public class TestCellFlatSet {
   @Parameterized.Parameters
   public static Object[] data() {
     return new Object[] { "SMALL_CHUNKS", "NORMAL_CHUNKS" }; // test with different chunk sizes
@@ -77,25 +75,22 @@ public class TestCellFlatSet extends TestCase {
   public TestCellFlatSet(String chunkType){
     long globalMemStoreLimit = (long) (ManagementFactory.getMemoryMXBean().getHeapMemoryUsage()
         .getMax() * MemorySizeUtil.getGlobalMemStoreHeapPercent(CONF, false));
-    if (chunkType == "NORMAL_CHUNKS") {
+    if (chunkType.equals("NORMAL_CHUNKS")) {
       chunkCreator = ChunkCreator.initialize(MemStoreLABImpl.CHUNK_SIZE_DEFAULT, false,
           globalMemStoreLimit, 0.2f, MemStoreLAB.POOL_INITIAL_SIZE_DEFAULT, null);
-      assertTrue(chunkCreator != null);
+      assertNotNull(chunkCreator);
       smallChunks = false;
     } else {
       // chunkCreator with smaller chunk size, so only 3 cell-representations can accommodate a chunk
       chunkCreator = ChunkCreator.initialize(SMALL_CHUNK_SIZE, false,
           globalMemStoreLimit, 0.2f, MemStoreLAB.POOL_INITIAL_SIZE_DEFAULT, null);
-      assertTrue(chunkCreator != null);
+      assertNotNull(chunkCreator);
       smallChunks = true;
     }
   }
 
   @Before
-  @Override
   public void setUp() throws Exception {
-    super.setUp();
-
     // create array of Cells to bass to the CellFlatMap under CellSet
     final byte[] one = Bytes.toBytes(15);
     final byte[] two = Bytes.toBytes(25);
@@ -126,7 +121,7 @@ public class TestCellFlatSet extends TestCase {
     ascCCM = setUpCellChunkMap(true);
     descCCM = setUpCellChunkMap(false);
 
-    if (smallChunks == true) {    // check jumbo chunks as well
+    if (smallChunks) {    // check jumbo chunks as well
       ascCCM = setUpJumboCellChunkMap(true);
     }
   }

http://git-wip-us.apache.org/repos/asf/hbase/blob/93a182f2/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestCellSkipListSet.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestCellSkipListSet.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestCellSkipListSet.java
index 4fa06b0..a58a22e 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestCellSkipListSet.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestCellSkipListSet.java
@@ -36,6 +36,7 @@ public class TestCellSkipListSet extends TestCase {
   private final CellSet csls =
     new CellSet(CellComparatorImpl.COMPARATOR);
 
+  @Override
   protected void setUp() throws Exception {
     super.setUp();
     this.csls.clear();

http://git-wip-us.apache.org/repos/asf/hbase/blob/93a182f2/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestCompactingMemStore.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestCompactingMemStore.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestCompactingMemStore.java
index c0ba621..87e4aff 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestCompactingMemStore.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestCompactingMemStore.java
@@ -56,6 +56,7 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNull;
 import static org.junit.Assert.assertTrue;
 
 /**
@@ -197,7 +198,7 @@ public class TestCompactingMemStore extends TestDefaultMemStore {
       Cell nr = ((CompactingMemStore)this.memstore).getNextRow(new KeyValue(Bytes.toBytes(i),
           System.currentTimeMillis()));
       if (i + 1 == ROW_COUNT) {
-        assertEquals(nr, null);
+        assertNull(nr);
       } else {
         assertTrue(CellComparator.getInstance().compareRows(nr,
             new KeyValue(Bytes.toBytes(i + 1), System.currentTimeMillis())) == 0);
@@ -317,7 +318,7 @@ public class TestCompactingMemStore extends TestDefaultMemStore {
       EnvironmentEdgeForMemstoreTest edge = new EnvironmentEdgeForMemstoreTest();
       EnvironmentEdgeManager.injectEdge(edge);
       long t = memstore.timeOfOldestEdit();
-      assertEquals(t, Long.MAX_VALUE);
+      assertEquals(Long.MAX_VALUE, t);
 
       // test the case that the timeOfOldestEdit is updated after a KV add
       memstore.add(KeyValueTestUtil.create("r", "f", "q", 100, "v"), null);

http://git-wip-us.apache.org/repos/asf/hbase/blob/93a182f2/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestCompactingToCellFlatMapMemStore.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestCompactingToCellFlatMapMemStore.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestCompactingToCellFlatMapMemStore.java
index 679ccf9..086ac8b 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestCompactingToCellFlatMapMemStore.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestCompactingToCellFlatMapMemStore.java
@@ -454,7 +454,7 @@ public class TestCompactingToCellFlatMapMemStore extends TestCompactingMemStore
         count++;
       }
     }
-    assertEquals("the count should be ", count, 150);
+    assertEquals("the count should be ", 150, count);
     for(int i = 0; i < scanners.size(); i++) {
       scanners.get(i).close();
     }
@@ -481,7 +481,7 @@ public class TestCompactingToCellFlatMapMemStore extends TestCompactingMemStore
     } finally {
       itr.close();
     }
-    assertEquals("the count should be ", cnt, 150);
+    assertEquals("the count should be ", 150, cnt);
   }
 
   private void addRowsByKeysWith50Cols(AbstractMemStore hmc, String[] keys) {

http://git-wip-us.apache.org/repos/asf/hbase/blob/93a182f2/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestCompaction.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestCompaction.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestCompaction.java
index afe3228..f017617 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestCompaction.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestCompaction.java
@@ -116,7 +116,8 @@ public class TestCompaction {
     // Increment the least significant character so we get to next row.
     secondRowBytes[START_KEY_BYTES.length - 1]++;
     thirdRowBytes = START_KEY_BYTES.clone();
-    thirdRowBytes[START_KEY_BYTES.length - 1] += 2;
+    thirdRowBytes[START_KEY_BYTES.length - 1] =
+        (byte) (thirdRowBytes[START_KEY_BYTES.length - 1] + 2);
   }
 
   @Before
@@ -264,7 +265,7 @@ public class TestCompaction {
     FileSystem fs = store.getFileSystem();
     // default compaction policy created one and only one new compacted file
     Path dstPath = store.getRegionFileSystem().createTempName();
-    FSDataOutputStream stream = fs.create(dstPath, null, true, 512, (short)3, (long)1024, null);
+    FSDataOutputStream stream = fs.create(dstPath, null, true, 512, (short)3, 1024L, null);
     stream.writeChars("CORRUPT FILE!!!!");
     stream.close();
     Path origPath = store.getRegionFileSystem().commitStoreFile(
@@ -390,7 +391,7 @@ public class TestCompaction {
   class StoreMockMaker extends StatefulStoreMockMaker {
     public ArrayList<HStoreFile> compacting = new ArrayList<>();
     public ArrayList<HStoreFile> notCompacting = new ArrayList<>();
-    private ArrayList<Integer> results;
+    private final ArrayList<Integer> results;
 
     public StoreMockMaker(ArrayList<Integer> results) {
       this.results = results;

http://git-wip-us.apache.org/repos/asf/hbase/blob/93a182f2/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestCompactionArchiveConcurrentClose.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestCompactionArchiveConcurrentClose.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestCompactionArchiveConcurrentClose.java
index d2e1866..e9f381e 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestCompactionArchiveConcurrentClose.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestCompactionArchiveConcurrentClose.java
@@ -125,6 +125,7 @@ public class TestCompactionArchiveConcurrentClose {
 
     // now run the cleaner with a concurrent close
     Thread cleanerThread = new Thread() {
+      @Override
       public void run() {
         cleaner.chore();
       }
@@ -138,6 +139,7 @@ public class TestCompactionArchiveConcurrentClose {
     }
     final AtomicReference<Exception> closeException = new AtomicReference<>();
     Thread closeThread = new Thread() {
+      @Override
       public void run() {
         // wait for the chore to complete and call close
         try {

http://git-wip-us.apache.org/repos/asf/hbase/blob/93a182f2/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestCompactionFileNotFound.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestCompactionFileNotFound.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestCompactionFileNotFound.java
index 112fe4d..0dafd80 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestCompactionFileNotFound.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestCompactionFileNotFound.java
@@ -141,7 +141,7 @@ public class TestCompactionFileNotFound {
         }
       });
       // Split at this point should not result in the RS being aborted
-      assertEquals(util.getMiniHBaseCluster().getLiveRegionServerThreads().size(), 3);
+      assertEquals(3, util.getMiniHBaseCluster().getLiveRegionServerThreads().size());
     } finally {
       if (admin != null) {
         admin.close();

http://git-wip-us.apache.org/repos/asf/hbase/blob/93a182f2/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestDefaultMemStore.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestDefaultMemStore.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestDefaultMemStore.java
index b89fb0e..53e04e0 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestDefaultMemStore.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestDefaultMemStore.java
@@ -575,7 +575,7 @@ public class TestDefaultMemStore {
       Cell nr = ((DefaultMemStore) this.memstore).getNextRow(new KeyValue(Bytes.toBytes(i),
           System.currentTimeMillis()));
       if (i + 1 == ROW_COUNT) {
-        assertEquals(nr, null);
+        assertNull(nr);
       } else {
         assertTrue(CellComparatorImpl.COMPARATOR.compareRows(nr,
             new KeyValue(Bytes.toBytes(i + 1), System.currentTimeMillis())) == 0);
@@ -863,7 +863,7 @@ public class TestDefaultMemStore {
       EnvironmentEdgeManager.injectEdge(edge);
       DefaultMemStore memstore = new DefaultMemStore();
       long t = memstore.timeOfOldestEdit();
-      assertEquals(t, Long.MAX_VALUE);
+      assertEquals(Long.MAX_VALUE, t);
 
       // test the case that the timeOfOldestEdit is updated after a KV add
       memstore.add(KeyValueTestUtil.create("r", "f", "q", 100, "v"), null);

http://git-wip-us.apache.org/repos/asf/hbase/blob/93a182f2/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestGetClosestAtOrBefore.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestGetClosestAtOrBefore.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestGetClosestAtOrBefore.java
index 642b471..aa38b7a 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestGetClosestAtOrBefore.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestGetClosestAtOrBefore.java
@@ -19,6 +19,7 @@
 package org.apache.hadoop.hbase.regionserver;
 
 import java.io.IOException;
+import java.nio.charset.StandardCharsets;
 import java.util.ArrayList;
 import java.util.List;
 import java.util.Objects;
@@ -168,7 +169,7 @@ public class TestGetClosestAtOrBefore  {
     byte [] metaKey = HRegionInfo.createRegionName(
         tableb, tofindBytes,
       HConstants.NINES, false);
-    LOG.info("find=" + new String(metaKey));
+    LOG.info("find=" + new String(metaKey, StandardCharsets.UTF_8));
     Result r = UTIL.getClosestRowBefore(mr, metaKey, HConstants.CATALOG_FAMILY);
     if (answer == -1) {
       assertNull(r);

http://git-wip-us.apache.org/repos/asf/hbase/blob/93a182f2/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHRegion.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHRegion.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHRegion.java
index 3c11b31..ee11075 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHRegion.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHRegion.java
@@ -43,6 +43,7 @@ import static org.mockito.Mockito.when;
 import java.io.IOException;
 import java.io.InterruptedIOException;
 import java.math.BigDecimal;
+import java.nio.charset.StandardCharsets;
 import java.security.PrivilegedExceptionAction;
 import java.util.ArrayList;
 import java.util.Arrays;
@@ -669,7 +670,7 @@ public class TestHRegion {
       MonitoredTask status = TaskMonitor.get().createStatus(method);
       Map<byte[], Long> maxSeqIdInStores = new TreeMap<>(Bytes.BYTES_COMPARATOR);
       for (HStore store : region.getStores()) {
-        maxSeqIdInStores.put(store.getColumnFamilyName().getBytes(), minSeqId - 1);
+        maxSeqIdInStores.put(Bytes.toBytes(store.getColumnFamilyName()), minSeqId - 1);
       }
       long seqId = region.replayRecoveredEditsIfAny(regiondir, maxSeqIdInStores, null, status);
       assertEquals(maxSeqId, seqId);
@@ -721,7 +722,7 @@ public class TestHRegion {
       MonitoredTask status = TaskMonitor.get().createStatus(method);
       Map<byte[], Long> maxSeqIdInStores = new TreeMap<>(Bytes.BYTES_COMPARATOR);
       for (HStore store : region.getStores()) {
-        maxSeqIdInStores.put(store.getColumnFamilyName().getBytes(), recoverSeqId - 1);
+        maxSeqIdInStores.put(Bytes.toBytes(store.getColumnFamilyName()), recoverSeqId - 1);
       }
       long seqId = region.replayRecoveredEditsIfAny(regiondir, maxSeqIdInStores, null, status);
       assertEquals(maxSeqId, seqId);
@@ -766,7 +767,7 @@ public class TestHRegion {
 
       Map<byte[], Long> maxSeqIdInStores = new TreeMap<>(Bytes.BYTES_COMPARATOR);
       for (HStore store : region.getStores()) {
-        maxSeqIdInStores.put(store.getColumnFamilyName().getBytes(), minSeqId);
+        maxSeqIdInStores.put(Bytes.toBytes(store.getColumnFamilyName()), minSeqId);
       }
       long seqId = region.replayRecoveredEditsIfAny(regiondir, maxSeqIdInStores, null, null);
       assertEquals(minSeqId, seqId);
@@ -824,7 +825,7 @@ public class TestHRegion {
       Map<byte[], Long> maxSeqIdInStores = new TreeMap<>(Bytes.BYTES_COMPARATOR);
       MonitoredTask status = TaskMonitor.get().createStatus(method);
       for (HStore store : region.getStores()) {
-        maxSeqIdInStores.put(store.getColumnFamilyName().getBytes(), recoverSeqId - 1);
+        maxSeqIdInStores.put(Bytes.toBytes(store.getColumnFamilyName()), recoverSeqId - 1);
       }
       long seqId = region.replayRecoveredEditsIfAny(regiondir, maxSeqIdInStores, null, status);
       assertEquals(maxSeqId, seqId);
@@ -1070,7 +1071,7 @@ public class TestHRegion {
     }
   }
 
-  class IsFlushWALMarker implements ArgumentMatcher<WALEdit> {
+  static class IsFlushWALMarker implements ArgumentMatcher<WALEdit> {
     volatile FlushAction[] actions;
     public IsFlushWALMarker(FlushAction... actions) {
       this.actions = actions;
@@ -2192,7 +2193,7 @@ public class TestHRegion {
         deleteMap.put(family, kvs);
         region.delete(deleteMap, Durability.SYNC_WAL);
       } catch (Exception e) {
-        assertTrue("Family " + new String(family) + " does not exist", false);
+        fail("Family " + new String(family, StandardCharsets.UTF_8) + " does not exist");
       }
 
       // testing non existing family
@@ -2205,7 +2206,8 @@ public class TestHRegion {
       } catch (Exception e) {
         ok = true;
       }
-      assertEquals("Family " + new String(family) + " does exist", true, ok);
+      assertEquals("Family " + new String(family, StandardCharsets.UTF_8) + " does exist",
+          true, ok);
     } finally {
       HBaseTestingUtility.closeRegionAndWAL(this.region);
       this.region = null;
@@ -3467,18 +3469,18 @@ public class TestHRegion {
 
       List<Cell> results = new ArrayList<>();
       assertTrue(s.next(results));
-      assertEquals(results.size(), 1);
+      assertEquals(1, results.size());
       results.clear();
 
       assertTrue(s.next(results));
-      assertEquals(results.size(), 3);
+      assertEquals(3, results.size());
       assertTrue("orderCheck", CellUtil.matchingFamily(results.get(0), cf_alpha));
       assertTrue("orderCheck", CellUtil.matchingFamily(results.get(1), cf_essential));
       assertTrue("orderCheck", CellUtil.matchingFamily(results.get(2), cf_joined));
       results.clear();
 
       assertFalse(s.next(results));
-      assertEquals(results.size(), 0);
+      assertEquals(0, results.size());
     } finally {
       HBaseTestingUtility.closeRegionAndWAL(this.region);
       this.region = null;
@@ -3564,16 +3566,19 @@ public class TestHRegion {
       while (true) {
         boolean more = s.next(results, scannerContext);
         if ((index >> 1) < 5) {
-          if (index % 2 == 0)
-            assertEquals(results.size(), 3);
-          else
-            assertEquals(results.size(), 1);
-        } else
-          assertEquals(results.size(), 1);
+          if (index % 2 == 0) {
+            assertEquals(3, results.size());
+          } else {
+            assertEquals(1, results.size());
+          }
+        } else {
+          assertEquals(1, results.size());
+        }
         results.clear();
         index++;
-        if (!more)
+        if (!more) {
           break;
+        }
       }
     } finally {
       HBaseTestingUtility.closeRegionAndWAL(this.region);
@@ -4448,7 +4453,7 @@ public class TestHRegion {
     // after all increment finished, the row will increment to 20*100 = 2000
     int threadNum = 20;
     int incCounter = 100;
-    long expected = threadNum * incCounter;
+    long expected = (long) threadNum * incCounter;
     Thread[] incrementers = new Thread[threadNum];
     Thread flushThread = new Thread(flusher);
     for (int i = 0; i < threadNum; i++) {
@@ -4470,7 +4475,7 @@ public class TestHRegion {
     List<Cell> kvs = res.getColumnCells(Incrementer.family, Incrementer.qualifier);
 
     // we just got the latest version
-    assertEquals(kvs.size(), 1);
+    assertEquals(1, kvs.size());
     Cell kv = kvs.get(0);
     assertEquals(expected, Bytes.toLong(kv.getValueArray(), kv.getValueOffset()));
     this.region = null;
@@ -4561,7 +4566,7 @@ public class TestHRegion {
     List<Cell> kvs = res.getColumnCells(Appender.family, Appender.qualifier);
 
     // we just got the latest version
-    assertEquals(kvs.size(), 1);
+    assertEquals(1, kvs.size());
     Cell kv = kvs.get(0);
     byte[] appendResult = new byte[kv.getValueLength()];
     System.arraycopy(kv.getValueArray(), kv.getValueOffset(), appendResult, 0, kv.getValueLength());
@@ -6150,7 +6155,7 @@ public class TestHRegion {
       r = region.get(new Get(row));
       byte[] val = r.getValue(fam1, q1);
       assertNotNull(val);
-      assertEquals(Bytes.toLong(val), 1L);
+      assertEquals(1L, Bytes.toLong(val));
 
       // Increment with a TTL of 5 seconds
       Increment incr = new Increment(row).addColumn(fam1, q1, 1L);
@@ -6161,7 +6166,7 @@ public class TestHRegion {
       r = region.get(new Get(row));
       val = r.getValue(fam1, q1);
       assertNotNull(val);
-      assertEquals(Bytes.toLong(val), 2L);
+      assertEquals(2L, Bytes.toLong(val));
 
       // Increment time to T+25 seconds
       edge.incrementTime(5000);
@@ -6170,7 +6175,7 @@ public class TestHRegion {
       r = region.get(new Get(row));
       val = r.getValue(fam1, q1);
       assertNotNull(val);
-      assertEquals(Bytes.toLong(val), 1L);
+      assertEquals(1L, Bytes.toLong(val));
 
       // Increment time to T+30 seconds
       edge.incrementTime(5000);
@@ -6199,14 +6204,14 @@ public class TestHRegion {
     Result result = region.get(new Get(row));
     Cell c = result.getColumnLatestCell(fam1, qual1);
     assertNotNull(c);
-    assertEquals(c.getTimestamp(), 10L);
+    assertEquals(10L, c.getTimestamp());
 
     edge.setValue(1); // clock goes back
     region.increment(inc);
     result = region.get(new Get(row));
     c = result.getColumnLatestCell(fam1, qual1);
-    assertEquals(c.getTimestamp(), 11L);
-    assertEquals(Bytes.toLong(c.getValueArray(), c.getValueOffset(), c.getValueLength()), 2L);
+    assertEquals(11L, c.getTimestamp());
+    assertEquals(2L, Bytes.toLong(c.getValueArray(), c.getValueOffset(), c.getValueLength()));
   }
 
   @Test
@@ -6224,13 +6229,13 @@ public class TestHRegion {
     Result result = region.get(new Get(row));
     Cell c = result.getColumnLatestCell(fam1, qual1);
     assertNotNull(c);
-    assertEquals(c.getTimestamp(), 10L);
+    assertEquals(10L, c.getTimestamp());
 
     edge.setValue(1); // clock goes back
     region.append(a);
     result = region.get(new Get(row));
     c = result.getColumnLatestCell(fam1, qual1);
-    assertEquals(c.getTimestamp(), 11L);
+    assertEquals(11L, c.getTimestamp());
 
     byte[] expected = new byte[qual1.length*2];
     System.arraycopy(qual1, 0, expected, 0, qual1.length);
@@ -6255,7 +6260,7 @@ public class TestHRegion {
     Result result = region.get(new Get(row));
     Cell c = result.getColumnLatestCell(fam1, qual1);
     assertNotNull(c);
-    assertEquals(c.getTimestamp(), 10L);
+    assertEquals(10L, c.getTimestamp());
 
     edge.setValue(1); // clock goes back
     p = new Put(row);
@@ -6264,7 +6269,7 @@ public class TestHRegion {
     region.checkAndMutate(row, fam1, qual1, CompareOperator.EQUAL, new BinaryComparator(qual1), p, false);
     result = region.get(new Get(row));
     c = result.getColumnLatestCell(fam1, qual1);
-    assertEquals(c.getTimestamp(), 10L);
+    assertEquals(10L, c.getTimestamp());
 
     assertTrue(Bytes.equals(c.getValueArray(), c.getValueOffset(), c.getValueLength(),
       qual2, 0, qual2.length));
@@ -6304,9 +6309,9 @@ public class TestHRegion {
     };
 
     OperationStatus[] status = region.batchMutate(mutations);
-    assertEquals(status[0].getOperationStatusCode(), OperationStatusCode.SUCCESS);
-    assertEquals(status[1].getOperationStatusCode(), OperationStatusCode.SANITY_CHECK_FAILURE);
-    assertEquals(status[2].getOperationStatusCode(), OperationStatusCode.SUCCESS);
+    assertEquals(OperationStatusCode.SUCCESS, status[0].getOperationStatusCode());
+    assertEquals(OperationStatusCode.SANITY_CHECK_FAILURE, status[1].getOperationStatusCode());
+    assertEquals(OperationStatusCode.SUCCESS, status[2].getOperationStatusCode());
 
 
     // test with a row lock held for a long time
@@ -6347,8 +6352,8 @@ public class TestHRegion {
 
         // this will wait for the row lock, and it will eventually succeed
         OperationStatus[] status = region.batchMutate(mutations);
-        assertEquals(status[0].getOperationStatusCode(), OperationStatusCode.SUCCESS);
-        assertEquals(status[1].getOperationStatusCode(), OperationStatusCode.SUCCESS);
+        assertEquals(OperationStatusCode.SUCCESS, status[0].getOperationStatusCode());
+        assertEquals(OperationStatusCode.SUCCESS, status[1].getOperationStatusCode());
         return null;
       }
     });
@@ -6374,7 +6379,7 @@ public class TestHRegion {
     Result result = region.get(new Get(row));
     Cell c = result.getColumnLatestCell(fam1, qual1);
     assertNotNull(c);
-    assertEquals(c.getTimestamp(), 10L);
+    assertEquals(10L, c.getTimestamp());
 
     edge.setValue(1); // clock goes back
     p = new Put(row);
@@ -6386,7 +6391,7 @@ public class TestHRegion {
         new BinaryComparator(qual1), rm, false));
     result = region.get(new Get(row));
     c = result.getColumnLatestCell(fam1, qual1);
-    assertEquals(c.getTimestamp(), 10L);
+    assertEquals(10L, c.getTimestamp());
     LOG.info("c value " +
       Bytes.toStringBinary(c.getValueArray(), c.getValueOffset(), c.getValueLength()));
 

http://git-wip-us.apache.org/repos/asf/hbase/blob/93a182f2/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHRegionReplayEvents.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHRegionReplayEvents.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHRegionReplayEvents.java
index d5e7e75..bdc5c55 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHRegionReplayEvents.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHRegionReplayEvents.java
@@ -232,7 +232,7 @@ public class TestHRegionReplayEvents {
 
     // flush region
     FlushResultImpl flush = (FlushResultImpl)secondaryRegion.flush(true);
-    assertEquals(flush.result, FlushResultImpl.Result.CANNOT_FLUSH);
+    assertEquals(FlushResultImpl.Result.CANNOT_FLUSH, flush.result);
 
     verifyData(secondaryRegion, 0, 1000, cq, families);
 
@@ -1207,13 +1207,13 @@ public class TestHRegionReplayEvents {
     // primary region is empty at this point. Request a flush with writeFlushRequestWalMarker=false
     FlushResultImpl result = primaryRegion.flushcache(true, false, FlushLifeCycleTracker.DUMMY);
     assertNotNull(result);
-    assertEquals(result.result, FlushResultImpl.Result.CANNOT_FLUSH_MEMSTORE_EMPTY);
+    assertEquals(FlushResultImpl.Result.CANNOT_FLUSH_MEMSTORE_EMPTY, result.result);
     assertFalse(result.wroteFlushWalMarker);
 
     // request flush again, but this time with writeFlushRequestWalMarker = true
     result = primaryRegion.flushcache(true, true, FlushLifeCycleTracker.DUMMY);
     assertNotNull(result);
-    assertEquals(result.result, FlushResultImpl.Result.CANNOT_FLUSH_MEMSTORE_EMPTY);
+    assertEquals(FlushResultImpl.Result.CANNOT_FLUSH_MEMSTORE_EMPTY, result.result);
     assertTrue(result.wroteFlushWalMarker);
 
     List<FlushDescriptor> flushes = Lists.newArrayList();
@@ -1644,7 +1644,7 @@ public class TestHRegionReplayEvents {
       hFileFactory.withFileContext(new HFileContext());
       HFile.Writer writer = hFileFactory.create();
       try {
-        writer.append(new KeyValue(CellUtil.createCell(valueBytes, family, valueBytes, 0l,
+        writer.append(new KeyValue(CellUtil.createCell(valueBytes, family, valueBytes, 0L,
           KeyValue.Type.Put.getCode(), valueBytes)));
       } finally {
         writer.close();

http://git-wip-us.apache.org/repos/asf/hbase/blob/93a182f2/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHRegionServerBulkLoad.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHRegionServerBulkLoad.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHRegionServerBulkLoad.java
index b6b39bc..034d9d7 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHRegionServerBulkLoad.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHRegionServerBulkLoad.java
@@ -186,6 +186,7 @@ public class TestHRegionServerBulkLoad {
       this.tableName = tableName;
     }
 
+    @Override
     public void doAnAction() throws Exception {
       long iteration = numBulkLoads.getAndIncrement();
       Path dir =  UTIL.getDataTestDirOnTestFS(String.format("bulkLoad_%08d",
@@ -295,6 +296,7 @@ public class TestHRegionServerBulkLoad {
       table = UTIL.getConnection().getTable(TABLE_NAME);
     }
 
+    @Override
     public void doAnAction() throws Exception {
       Scan s = new Scan();
       for (byte[] family : targetFamilies) {

http://git-wip-us.apache.org/repos/asf/hbase/blob/93a182f2/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHStore.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHStore.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHStore.java
index b8d3ec7..288333b 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHStore.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHStore.java
@@ -756,7 +756,7 @@ public class TestHStore {
     }
 
     @Override
-    public void write(byte[] buf, int offset, int length) throws IOException {
+    public synchronized void write(byte[] buf, int offset, int length) throws IOException {
       System.err.println("faulty stream write at pos " + getPos());
       injectFault();
       super.write(buf, offset, length);
@@ -1551,7 +1551,7 @@ public class TestHStore {
       ColumnFamilyDescriptorBuilder.newBuilder(family).setMaxVersions(5).build(), hook);
   }
 
-  private class MyStore extends HStore {
+  private static class MyStore extends HStore {
     private final MyStoreHook hook;
 
     MyStore(final HRegion region, final ColumnFamilyDescriptor family, final Configuration
@@ -1576,7 +1576,7 @@ public class TestHStore {
     }
   }
 
-  private abstract class MyStoreHook {
+  private abstract static class MyStoreHook {
 
     void getScanners(MyStore store) throws IOException {
     }
@@ -1595,7 +1595,7 @@ public class TestHStore {
     MyStore store = initMyStore(name.getMethodName(), conf, new MyStoreHook() {});
     MemStoreSizing memStoreSizing = new MemStoreSizing();
     long ts = System.currentTimeMillis();
-    long seqID = 1l;
+    long seqID = 1L;
     // Add some data to the region and do some flushes
     for (int i = 1; i < 10; i++) {
       store.add(createCell(Bytes.toBytes("row" + i), qf1, ts, seqID++, Bytes.toBytes("")),
@@ -1663,6 +1663,7 @@ public class TestHStore {
       return this.heap;
     }
 
+    @Override
     public void run() {
       scanner.trySwitchToStreamRead();
       heap = scanner.heap;

http://git-wip-us.apache.org/repos/asf/hbase/blob/93a182f2/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHStoreFile.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHStoreFile.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHStoreFile.java
index 31f16ea..1a38d7f 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHStoreFile.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHStoreFile.java
@@ -90,11 +90,13 @@ public class TestHStoreFile extends HBaseTestCase {
   private static final int CKBYTES = 512;
   private static String TEST_FAMILY = "cf";
 
+  @Override
   @Before
   public void setUp() throws Exception {
     super.setUp();
   }
 
+  @Override
   @After
   public void tearDown() throws Exception {
     super.tearDown();
@@ -505,8 +507,8 @@ public class TestHStoreFile extends HBaseTestCase {
     long now = System.currentTimeMillis();
     for (int i = 0; i < 2000; i += 2) {
       String row = String.format(localFormatter, i);
-      KeyValue kv = new KeyValue(row.getBytes(), "family".getBytes(),
-        "col".getBytes(), now, "value".getBytes());
+      KeyValue kv = new KeyValue(Bytes.toBytes(row), Bytes.toBytes("family"),
+        Bytes.toBytes("col"), now, Bytes.toBytes("value"));
       writer.append(kv);
     }
     writer.close();
@@ -523,12 +525,13 @@ public class TestHStoreFile extends HBaseTestCase {
     for (int i = 0; i < 2000; i++) {
       String row = String.format(localFormatter, i);
       TreeSet<byte[]> columns = new TreeSet<>(Bytes.BYTES_COMPARATOR);
-      columns.add("family:col".getBytes());
+      columns.add(Bytes.toBytes("family:col"));
 
-      Scan scan = new Scan(row.getBytes(),row.getBytes());
-      scan.addColumn("family".getBytes(), "family:col".getBytes());
+      Scan scan = new Scan(Bytes.toBytes(row),Bytes.toBytes(row));
+      scan.addColumn(Bytes.toBytes("family"), Bytes.toBytes("family:col"));
       HStore store = mock(HStore.class);
-      when(store.getColumnFamilyDescriptor()).thenReturn(ColumnFamilyDescriptorBuilder.of("family"));
+      when(store.getColumnFamilyDescriptor())
+          .thenReturn(ColumnFamilyDescriptorBuilder.of("family"));
       boolean exists = scanner.shouldUseScanner(scan, store, Long.MIN_VALUE);
       if (i % 2 == 0) {
         if (!exists) falseNeg++;
@@ -592,8 +595,8 @@ public class TestHStoreFile extends HBaseTestCase {
     long now = System.currentTimeMillis();
     for (int i = 0; i < 2000; i += 2) {
       String row = String.format(localFormatter, i);
-      KeyValue kv = new KeyValue(row.getBytes(), "family".getBytes(),
-          "col".getBytes(), now, KeyValue.Type.DeleteFamily, "value".getBytes());
+      KeyValue kv = new KeyValue(Bytes.toBytes(row), Bytes.toBytes("family"),
+          Bytes.toBytes("col"), now, KeyValue.Type.DeleteFamily, Bytes.toBytes("value"));
       writer.append(kv);
     }
     writer.close();
@@ -696,9 +699,8 @@ public class TestHStoreFile extends HBaseTestCase {
           String row = String.format(localFormatter, i);
           String col = String.format(localFormatter, j);
           for (int k= 0; k < versions; ++k) { // versions
-            KeyValue kv = new KeyValue(row.getBytes(),
-              "family".getBytes(), ("col" + col).getBytes(),
-                now-k, Bytes.toBytes((long)-1));
+            KeyValue kv = new KeyValue(Bytes.toBytes(row), Bytes.toBytes("family"),
+                Bytes.toBytes("col" + col), now-k, Bytes.toBytes(-1L));
             writer.append(kv);
           }
         }
@@ -713,7 +715,8 @@ public class TestHStoreFile extends HBaseTestCase {
       assertEquals(expKeys[x], reader.generalBloomFilter.getKeyCount());
 
       HStore store = mock(HStore.class);
-      when(store.getColumnFamilyDescriptor()).thenReturn(ColumnFamilyDescriptorBuilder.of("family"));
+      when(store.getColumnFamilyDescriptor())
+          .thenReturn(ColumnFamilyDescriptorBuilder.of("family"));
       // check false positives rate
       int falsePos = 0;
       int falseNeg = 0;
@@ -722,10 +725,10 @@ public class TestHStoreFile extends HBaseTestCase {
           String row = String.format(localFormatter, i);
           String col = String.format(localFormatter, j);
           TreeSet<byte[]> columns = new TreeSet<>(Bytes.BYTES_COMPARATOR);
-          columns.add(("col" + col).getBytes());
+          columns.add(Bytes.toBytes("col" + col));
 
-          Scan scan = new Scan(row.getBytes(),row.getBytes());
-          scan.addColumn("family".getBytes(), ("col"+col).getBytes());
+          Scan scan = new Scan(Bytes.toBytes(row),Bytes.toBytes(row));
+          scan.addColumn(Bytes.toBytes("family"), Bytes.toBytes(("col"+col)));
 
           boolean exists =
               scanner.shouldUseScanner(scan, store, Long.MIN_VALUE);

http://git-wip-us.apache.org/repos/asf/hbase/blob/93a182f2/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestKeyValueHeap.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestKeyValueHeap.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestKeyValueHeap.java
index 24ab7a1..d9956de 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestKeyValueHeap.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestKeyValueHeap.java
@@ -88,6 +88,7 @@ public class TestKeyValueHeap extends HBaseTestCase {
     return actual;
   }
 
+  @Override
   @Before
   public void setUp() throws Exception {
     super.setUp();
@@ -185,7 +186,7 @@ public class TestKeyValueHeap extends HBaseTestCase {
     for (KeyValueScanner scanner : scanners) {
       // Verify that close is called and only called once for each scanner
       assertTrue(((SeekTestScanner) scanner).isClosed());
-      assertEquals(((SeekTestScanner) scanner).getClosedNum(), 1);
+      assertEquals(1, ((SeekTestScanner) scanner).getClosedNum());
     }
   }
 

http://git-wip-us.apache.org/repos/asf/hbase/blob/93a182f2/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestMajorCompaction.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestMajorCompaction.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestMajorCompaction.java
index 2684bdf..0840a63 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestMajorCompaction.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestMajorCompaction.java
@@ -108,7 +108,8 @@ public class TestMajorCompaction {
     // Increment the least significant character so we get to next row.
     secondRowBytes[START_KEY_BYTES.length - 1]++;
     thirdRowBytes = START_KEY_BYTES.clone();
-    thirdRowBytes[START_KEY_BYTES.length - 1] += 2;
+    thirdRowBytes[START_KEY_BYTES.length - 1] =
+        (byte) (thirdRowBytes[START_KEY_BYTES.length - 1] + 2);
   }
 
   @Before
@@ -277,7 +278,7 @@ public class TestMajorCompaction {
 
     // Force major compaction.
     r.compact(true);
-    assertEquals(r.getStore(COLUMN_FAMILY_TEXT).getStorefiles().size(), 1);
+    assertEquals(1, r.getStore(COLUMN_FAMILY_TEXT).getStorefiles().size());
 
     result = r.get(new Get(secondRowBytes).addFamily(COLUMN_FAMILY_TEXT).readVersions(100));
     assertTrue("Second row should still be deleted", result.isEmpty());
@@ -398,8 +399,8 @@ public class TestMajorCompaction {
 
   private void createSmallerStoreFile(final HRegion region) throws IOException {
     Table loader = new RegionAsTable(region);
-    HBaseTestCase.addContent(loader, Bytes.toString(COLUMN_FAMILY), ("" +
-        "bbb").getBytes(), null);
+    HBaseTestCase.addContent(loader, Bytes.toString(COLUMN_FAMILY), Bytes.toBytes("" +
+        "bbb"), null);
     region.flush(true);
   }
 

http://git-wip-us.apache.org/repos/asf/hbase/blob/93a182f2/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestMemStoreLAB.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestMemStoreLAB.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestMemStoreLAB.java
index 8d74d8d..795fa2f 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestMemStoreLAB.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestMemStoreLAB.java
@@ -62,8 +62,8 @@ public class TestMemStoreLAB {
 
   @BeforeClass
   public static void setUpBeforeClass() throws Exception {
-    ChunkCreator.initialize(1 * 1024, false, 50*1024000l, 0.2f, MemStoreLAB.POOL_INITIAL_SIZE_DEFAULT,
-      null);
+    ChunkCreator.initialize(1 * 1024, false, 50 * 1024000L, 0.2f,
+        MemStoreLAB.POOL_INITIAL_SIZE_DEFAULT, null);
   }
 
   @AfterClass

http://git-wip-us.apache.org/repos/asf/hbase/blob/93a182f2/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestMinorCompaction.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestMinorCompaction.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestMinorCompaction.java
index 98b0761..4ae92a4 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestMinorCompaction.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestMinorCompaction.java
@@ -76,7 +76,8 @@ public class TestMinorCompaction {
     // Increment the least significant character so we get to next row.
     secondRowBytes[START_KEY_BYTES.length - 1]++;
     thirdRowBytes = START_KEY_BYTES.clone();
-    thirdRowBytes[START_KEY_BYTES.length - 1] += 2;
+    thirdRowBytes[START_KEY_BYTES.length - 1] =
+        (byte) (thirdRowBytes[START_KEY_BYTES.length - 1] + 2);
     col1 = Bytes.toBytes("column1");
     col2 = Bytes.toBytes("column2");
   }

http://git-wip-us.apache.org/repos/asf/hbase/blob/93a182f2/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestMultiVersionConcurrencyControl.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestMultiVersionConcurrencyControl.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestMultiVersionConcurrencyControl.java
index 084c4c91..a09c8cd 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestMultiVersionConcurrencyControl.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestMultiVersionConcurrencyControl.java
@@ -46,6 +46,7 @@ public class TestMultiVersionConcurrencyControl {
     private Random rnd = new Random();
     public boolean failed = false;
 
+    @Override
     public void run() {
       while (!finished.get()) {
         MultiVersionConcurrencyControl.WriteEntry e =
@@ -82,6 +83,7 @@ public class TestMultiVersionConcurrencyControl {
     final AtomicBoolean readerFailed = new AtomicBoolean(false);
     final AtomicLong failedAt = new AtomicLong();
     Runnable reader = new Runnable() {
+      @Override
       public void run() {
         long prev = mvcc.getReadPoint();
         while (!finished.get()) {

http://git-wip-us.apache.org/repos/asf/hbase/blob/93a182f2/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestPriorityRpc.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestPriorityRpc.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestPriorityRpc.java
index a8b0f22..82b0251 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestPriorityRpc.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestPriorityRpc.java
@@ -24,30 +24,31 @@ import static org.junit.Assert.assertTrue;
 
 import java.io.IOException;
 
+import org.apache.hadoop.conf.Configuration;
+import org.apache.hadoop.hbase.HBaseConfiguration;
+import org.apache.hadoop.hbase.HBaseTestingUtility;
+import org.apache.hadoop.hbase.HConstants;
 import org.apache.hadoop.hbase.TableName;
 import org.apache.hadoop.hbase.client.RegionInfo;
 import org.apache.hadoop.hbase.client.RegionInfoBuilder;
+import org.apache.hadoop.hbase.ipc.PriorityFunction;
 import org.apache.hadoop.hbase.security.User;
 import org.apache.hadoop.hbase.testclassification.MediumTests;
 import org.apache.hadoop.hbase.testclassification.RegionServerTests;
-import org.apache.hadoop.conf.Configuration;
-import org.apache.hadoop.hbase.HBaseConfiguration;
-import org.apache.hadoop.hbase.HBaseTestingUtility;
-import org.apache.hadoop.hbase.HConstants;
-import org.apache.hadoop.hbase.ipc.PriorityFunction;
+import org.apache.hadoop.hbase.util.Bytes;
+import org.apache.hbase.thirdparty.com.google.protobuf.ByteString;
+import org.apache.hbase.thirdparty.com.google.protobuf.UnsafeByteOperations;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+import org.mockito.Mockito;
+
 import org.apache.hadoop.hbase.shaded.protobuf.generated.ClientProtos.Get;
 import org.apache.hadoop.hbase.shaded.protobuf.generated.ClientProtos.GetRequest;
 import org.apache.hadoop.hbase.shaded.protobuf.generated.ClientProtos.ScanRequest;
 import org.apache.hadoop.hbase.shaded.protobuf.generated.HBaseProtos.RegionSpecifier;
 import org.apache.hadoop.hbase.shaded.protobuf.generated.HBaseProtos.RegionSpecifier.RegionSpecifierType;
 import org.apache.hadoop.hbase.shaded.protobuf.generated.RPCProtos.RequestHeader;
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.experimental.categories.Category;
-import org.mockito.Mockito;
-
-import org.apache.hbase.thirdparty.com.google.protobuf.ByteString;
-import org.apache.hbase.thirdparty.com.google.protobuf.UnsafeByteOperations;
 
 /**
  * Tests that verify certain RPCs get a higher QoS.
@@ -85,7 +86,7 @@ public class TestPriorityRpc {
     RegionSpecifier regionSpecifier = regionSpecifierBuilder.build();
     getRequestBuilder.setRegion(regionSpecifier);
     Get.Builder getBuilder = Get.newBuilder();
-    getBuilder.setRow(UnsafeByteOperations.unsafeWrap("somerow".getBytes()));
+    getBuilder.setRow(UnsafeByteOperations.unsafeWrap(Bytes.toBytes("somerow")));
     getRequestBuilder.setGet(getBuilder.build());
     GetRequest getRequest = getRequestBuilder.build();
     RequestHeader header = headerBuilder.build();
@@ -96,7 +97,8 @@ public class TestPriorityRpc {
     RegionInfo mockRegionInfo = Mockito.mock(RegionInfo.class);
     Mockito.when(mockRpc.getRegion(Mockito.any())).thenReturn(mockRegion);
     Mockito.when(mockRegion.getRegionInfo()).thenReturn(mockRegionInfo);
-    Mockito.when(mockRegionInfo.getTable()).thenReturn(RegionInfoBuilder.FIRST_META_REGIONINFO.getTable());
+    Mockito.when(mockRegionInfo.getTable())
+        .thenReturn(RegionInfoBuilder.FIRST_META_REGIONINFO.getTable());
     // Presume type.
     ((AnnotationReadingPriorityFunction)priority).setRegionServer(mockRS);
     assertEquals(HConstants.SYSTEMTABLE_QOS, priority.getPriority(header, getRequest,


Mime
View raw message