Merge branch 'stable-3.1'

* stable-3.1:
  Bump Bazel version to 2.2.0
  Bump required Bazel version to 2.1.0
  Upgrade bazlets to latest stable-2.16 to build with 2.16.16 API
  Documentation: Remove bazel issue
  Documentation: Refactor to match other plugin documentation
  Documentation: Add missing alternative for plugin in-tree testing
  Upgrade bazlets to latest stable-2.16
  Upgrade bazlets to latest stable-2.16
  Upgrade bazlets to latest stable-2.15
  Upgrade bazlets to latest stable-2.14

Change-Id: I0f0e7e4f918b4d7f0fa1af2024a050bdea658a67
diff --git a/BUILD b/BUILD
index 35d676e..d5a550f 100644
--- a/BUILD
+++ b/BUILD
@@ -1,4 +1,3 @@
-load("@rules_java//java:defs.bzl", "java_library")
 load("//tools/bzl:junit.bzl", "junit_tests")
 load(
     "//tools/bzl:plugin.bzl",
diff --git a/src/main/java/com/googlesource/gerrit/plugins/webhooks/rest/ProjectsCollection.java b/src/main/java/com/googlesource/gerrit/plugins/webhooks/rest/ProjectsCollection.java
index a31f99c..5e1d54d 100644
--- a/src/main/java/com/googlesource/gerrit/plugins/webhooks/rest/ProjectsCollection.java
+++ b/src/main/java/com/googlesource/gerrit/plugins/webhooks/rest/ProjectsCollection.java
@@ -53,7 +53,7 @@
 
   private ProjectWebhooksResource parse(String id) throws ResourceNotFoundException {
     Project.NameKey n = Project.nameKey(id);
-    if (projectCache.get(n) != null) {
+    if (projectCache.get(n).isPresent()) {
       return new ProjectWebhooksResource(Project.nameKey(id));
     }
     throw new ResourceNotFoundException(String.format("Project %s does not exist", id));