@Override
        public Void run() throws Exception {
          try (Connection connection = ConnectionFactory.createConnection(conf);
            Table table = connection.getTable(tableName)) {
            Put put = new Put(row1);
            put.addColumn(fam, qual, HConstants.LATEST_TIMESTAMP, val);
            put.setCellVisibility(new CellVisibility(TOPSECRET));
            table.put(put);
          }
          return null;
        }
Test visibility by setting 'hbase.security.visibility.mutations.checkauths' to true
hbase-server/src/test/java/org/apache/hadoop/hbase/security/visibility/TestVisibilityWithCheckAuths.java