Set formatting in all files to google-java-format

Change-Id: I751a48bbde85dd934cca29038203dbaebd7bcb12
diff --git a/src/main/java/com/googlesource/gerrit/plugins/uploadvalidator/BlockedKeywordValidator.java b/src/main/java/com/googlesource/gerrit/plugins/uploadvalidator/BlockedKeywordValidator.java
index c8fa506..975a6cf 100644
--- a/src/main/java/com/googlesource/gerrit/plugins/uploadvalidator/BlockedKeywordValidator.java
+++ b/src/main/java/com/googlesource/gerrit/plugins/uploadvalidator/BlockedKeywordValidator.java
@@ -69,14 +69,18 @@
     return new AbstractModule() {
       @Override
       protected void configure() {
-        DynamicSet.bind(binder(), CommitValidationListener.class)
-            .to(BlockedKeywordValidator.class);
+        DynamicSet.bind(binder(), CommitValidationListener.class).to(BlockedKeywordValidator.class);
         bind(ProjectConfigEntry.class)
             .annotatedWith(Exports.named(KEY_CHECK_BLOCKED_KEYWORD_PATTERN))
-            .toInstance(new ProjectConfigEntry("Blocked Keyword Pattern", null,
-                ProjectConfigEntryType.ARRAY, null, false,
-                "Pushes of commits that contain files or commit messages with "
-                + "blocked keywords will be rejected."));
+            .toInstance(
+                new ProjectConfigEntry(
+                    "Blocked Keyword Pattern",
+                    null,
+                    ProjectConfigEntryType.ARRAY,
+                    null,
+                    false,
+                    "Pushes of commits that contain files or commit messages with "
+                        + "blocked keywords will be rejected."));
       }
     };
   }
@@ -89,7 +93,8 @@
   private final ValidatorConfig validatorConfig;
 
   @Inject
-  BlockedKeywordValidator(@PluginName String pluginName,
+  BlockedKeywordValidator(
+      @PluginName String pluginName,
       ContentTypeUtil contentTypeUtil,
       @Named(CACHE_NAME) LoadingCache<String, Pattern> patternCache,
       PluginConfigFactory cfgFactory,
@@ -108,21 +113,22 @@
   }
 
   @Override
-  public List<CommitValidationMessage> onCommitReceived(
-      CommitReceivedEvent receiveEvent) throws CommitValidationException {
+  public List<CommitValidationMessage> onCommitReceived(CommitReceivedEvent receiveEvent)
+      throws CommitValidationException {
     try {
-      PluginConfig cfg = cfgFactory
-          .getFromProjectConfigWithInheritance(
+      PluginConfig cfg =
+          cfgFactory.getFromProjectConfigWithInheritance(
               receiveEvent.project.getNameKey(), pluginName);
       if (isActive(cfg)
-          && validatorConfig.isEnabledForRef(receiveEvent.user,
-              receiveEvent.getProjectNameKey(), receiveEvent.getRefName(),
+          && validatorConfig.isEnabledForRef(
+              receiveEvent.user,
+              receiveEvent.getProjectNameKey(),
+              receiveEvent.getRefName(),
               KEY_CHECK_BLOCKED_KEYWORD)) {
         ImmutableMap<String, Pattern> blockedKeywordPatterns =
-            patternCache.getAll(Arrays
-                .asList(cfg.getStringList(KEY_CHECK_BLOCKED_KEYWORD_PATTERN)));
-        try (Repository repo =
-            repoManager.openRepository(receiveEvent.project.getNameKey())) {
+            patternCache.getAll(
+                Arrays.asList(cfg.getStringList(KEY_CHECK_BLOCKED_KEYWORD_PATTERN)));
+        try (Repository repo = repoManager.openRepository(receiveEvent.project.getNameKey())) {
           List<CommitValidationMessage> messages =
               performValidation(
                   repo,
@@ -137,8 +143,7 @@
         }
       }
     } catch (NoSuchProjectException | IOException | ExecutionException e) {
-      throw new CommitValidationException("failed to check on blocked keywords",
-          e);
+      throw new CommitValidationException("failed to check on blocked keywords", e);
     }
     return Collections.emptyList();
   }
@@ -152,10 +157,8 @@
       PluginConfig cfg)
       throws IOException, ExecutionException {
     List<CommitValidationMessage> messages = new LinkedList<>();
-    checkCommitMessageForBlockedKeywords(blockedKeywordPartterns, messages,
-        c.getFullMessage());
-    Map<String, ObjectId> content = CommitUtils.getChangedContent(
-        repo, c, revWalk);
+    checkCommitMessageForBlockedKeywords(blockedKeywordPartterns, messages, c.getFullMessage());
+    Map<String, ObjectId> content = CommitUtils.getChangedContent(repo, c, revWalk);
     for (String path : content.keySet()) {
       ObjectLoader ol = repo.open(content.get(path));
       if (contentTypeUtil.isBinary(ol, path, cfg)) {
@@ -168,33 +171,36 @@
 
   private static void checkCommitMessageForBlockedKeywords(
       ImmutableCollection<Pattern> blockedKeywordPatterns,
-      List<CommitValidationMessage> messages, String commitMessage) {
+      List<CommitValidationMessage> messages,
+      String commitMessage) {
     int line = 0;
     for (String l : commitMessage.split("[\r\n]+")) {
       line++;
-      checkLineForBlockedKeywords(blockedKeywordPatterns, messages,
-          Patch.COMMIT_MSG, line, l);
+      checkLineForBlockedKeywords(blockedKeywordPatterns, messages, Patch.COMMIT_MSG, line, l);
     }
   }
 
   private static void checkFileForBlockedKeywords(
       ImmutableCollection<Pattern> blockedKeywordPartterns,
-      List<CommitValidationMessage> messages, String path, ObjectLoader ol)
-          throws IOException {
-    try (BufferedReader br = new BufferedReader(
-        new InputStreamReader(ol.openStream(), StandardCharsets.UTF_8))) {
+      List<CommitValidationMessage> messages,
+      String path,
+      ObjectLoader ol)
+      throws IOException {
+    try (BufferedReader br =
+        new BufferedReader(new InputStreamReader(ol.openStream(), StandardCharsets.UTF_8))) {
       int line = 0;
       for (String l = br.readLine(); l != null; l = br.readLine()) {
         line++;
-        checkLineForBlockedKeywords(blockedKeywordPartterns, messages, path,
-            line, l);
+        checkLineForBlockedKeywords(blockedKeywordPartterns, messages, path, line, l);
       }
     }
   }
 
   private static void checkLineForBlockedKeywords(
       ImmutableCollection<Pattern> blockedKeywordPartterns,
-      List<CommitValidationMessage> messages, String path, int lineNumber,
+      List<CommitValidationMessage> messages,
+      String path,
+      int lineNumber,
       String line) {
     List<String> found = new ArrayList<>();
     for (Pattern p : blockedKeywordPartterns) {
@@ -204,9 +210,12 @@
       }
     }
     if (!found.isEmpty()) {
-      messages.add(new CommitValidationMessage(MessageFormat.format(
-          "blocked keyword(s) found in: {0} (Line: {1}) (found: {2})",
-          path, lineNumber, Joiner.on(", ").join(found)), true));
+      messages.add(
+          new CommitValidationMessage(
+              MessageFormat.format(
+                  "blocked keyword(s) found in: {0} (Line: {1}) (found: {2})",
+                  path, lineNumber, Joiner.on(", ").join(found)),
+              true));
     }
   }
 }
diff --git a/src/main/java/com/googlesource/gerrit/plugins/uploadvalidator/CommitUtils.java b/src/main/java/com/googlesource/gerrit/plugins/uploadvalidator/CommitUtils.java
index 0da4894..8df6412 100644
--- a/src/main/java/com/googlesource/gerrit/plugins/uploadvalidator/CommitUtils.java
+++ b/src/main/java/com/googlesource/gerrit/plugins/uploadvalidator/CommitUtils.java
@@ -31,51 +31,53 @@
 public class CommitUtils {
 
   /**
-   * This method spots all files which differ between the passed commit and its
-   * parents. The paths of the spotted files will be returned as a Set.
+   * This method spots all files which differ between the passed commit and its parents. The paths
+   * of the spotted files will be returned as a Set.
    *
    * @param repo The repository
    * @param c The commit
-   * @return A Set containing the paths of all files which differ between the
-   *     passed commit and its parents.
+   * @return A Set containing the paths of all files which differ between the passed commit and its
+   *     parents.
    * @throws IOException
    */
-  public static Set<String> getChangedPaths(
-      Repository repo,
-      RevCommit c,
-      RevWalk revWalk)
+  public static Set<String> getChangedPaths(Repository repo, RevCommit c, RevWalk revWalk)
       throws IOException {
     Map<String, ObjectId> content = getChangedContent(repo, c, revWalk);
     return content.keySet();
   }
 
   /**
-   * This method spots all files which differ between the passed commit and its
-   * parents. The spotted files will be returned as a Map. The structure of the
-   * returned map looks like this:
+   * This method spots all files which differ between the passed commit and its parents. The spotted
+   * files will be returned as a Map. The structure of the returned map looks like this:
+   *
    * <p>
+   *
    * <ul>
-   * <li> Key: Path to the changed file.</li>
-   * <li> Value: ObjectId of the changed file.</li>
-   * <ul>
+   *   <li>Key: Path to the changed file.
+   *   <li>Value: ObjectId of the changed file.
+   *       <ul>
+   *
    * @param repo The repository
    * @param c The commit
-   * @return A Map containing all files which differ between the passed commit
-   *     and its parents.
+   * @return A Map containing all files which differ between the passed commit and its parents.
    * @throws IOException
    */
-  public static Map<String, ObjectId> getChangedContent(Repository repo,
-      RevCommit c, RevWalk revWalk) throws IOException {
+  public static Map<String, ObjectId> getChangedContent(
+      Repository repo, RevCommit c, RevWalk revWalk) throws IOException {
     final Map<String, ObjectId> content = new HashMap<>();
 
-    visitChangedEntries(repo, c, revWalk, new TreeWalkVisitor() {
-      @Override
-      public void onVisit(TreeWalk tw) {
-        if (isFile(tw)) {
-          content.put(tw.getPathString(), tw.getObjectId(0));
-        }
-      }
-    });
+    visitChangedEntries(
+        repo,
+        c,
+        revWalk,
+        new TreeWalkVisitor() {
+          @Override
+          public void onVisit(TreeWalk tw) {
+            if (isFile(tw)) {
+              content.put(tw.getPathString(), tw.getObjectId(0));
+            }
+          }
+        });
     return content;
   }
 
@@ -85,9 +87,9 @@
   }
 
   /**
-   * This method spots all TreeWalk entries which differ between the passed
-   * commit and its parents. If a TreeWalk entry is found this method calls the
-   * onVisit() method of the class TreeWalkVisitor.
+   * This method spots all TreeWalk entries which differ between the passed commit and its parents.
+   * If a TreeWalk entry is found this method calls the onVisit() method of the class
+   * TreeWalkVisitor.
    *
    * @param repo The repository
    * @param c The commit
@@ -95,10 +97,7 @@
    * @throws IOException
    */
   public static void visitChangedEntries(
-      Repository repo,
-      RevCommit c,
-      RevWalk revWalk,
-      TreeWalkVisitor visitor) throws IOException {
+      Repository repo, RevCommit c, RevWalk revWalk, TreeWalkVisitor visitor) throws IOException {
     try (TreeWalk tw = new TreeWalk(revWalk.getObjectReader())) {
       tw.setRecursive(true);
       tw.setFilter(TreeFilter.ANY_DIFF);
diff --git a/src/main/java/com/googlesource/gerrit/plugins/uploadvalidator/ContentTypeUtil.java b/src/main/java/com/googlesource/gerrit/plugins/uploadvalidator/ContentTypeUtil.java
index 493a108..a0f8ea4 100644
--- a/src/main/java/com/googlesource/gerrit/plugins/uploadvalidator/ContentTypeUtil.java
+++ b/src/main/java/com/googlesource/gerrit/plugins/uploadvalidator/ContentTypeUtil.java
@@ -48,13 +48,18 @@
         bind(ContentTypeUtil.class);
         bind(ProjectConfigEntry.class)
             .annotatedWith(Exports.named(KEY_BINARY_TYPES))
-            .toInstance(new ProjectConfigEntry("Binary Types", null,
-                ProjectConfigEntryType.ARRAY, null, false,
-                "At the moment, there is no ideal solution to detect binary "
-                    + "files. But some checks shouldn't run on binary files "
-                    + "(e. g. InvalidLineEndingCheck). Because of that you can "
-                    + "enter content types to avoid that these checks run on "
-                    + "files with one of the entered content types."));
+            .toInstance(
+                new ProjectConfigEntry(
+                    "Binary Types",
+                    null,
+                    ProjectConfigEntryType.ARRAY,
+                    null,
+                    false,
+                    "At the moment, there is no ideal solution to detect binary "
+                        + "files. But some checks shouldn't run on binary files "
+                        + "(e. g. InvalidLineEndingCheck). Because of that you can "
+                        + "enter content types to avoid that these checks run on "
+                        + "files with one of the entered content types."));
       }
     };
   }
@@ -68,8 +73,7 @@
   private final Tika tika = new Tika(TikaConfig.getDefaultConfig());
 
   @Inject
-  ContentTypeUtil(
-      @Named(CACHE_NAME) LoadingCache<String, Pattern> patternCache) {
+  ContentTypeUtil(@Named(CACHE_NAME) LoadingCache<String, Pattern> patternCache) {
     this.patternCache = patternCache;
   }
 
@@ -80,22 +84,18 @@
     }
   }
 
-  public String getContentType(InputStream is, String pathname)
-      throws IOException {
+  public String getContentType(InputStream is, String pathname) throws IOException {
     Metadata metadata = new Metadata();
     metadata.set(Metadata.RESOURCE_NAME_KEY, pathname);
     return tika.detect(TikaInputStream.get(is), metadata);
   }
 
   @VisibleForTesting
-  boolean matchesAny(String s, String[] patterns)
-      throws ExecutionException {
+  boolean matchesAny(String s, String[] patterns) throws ExecutionException {
     for (String p : patterns) {
-      if (p.startsWith("^")
-          && patternCache.get(p).matcher(s).matches()) {
+      if (p.startsWith("^") && patternCache.get(p).matcher(s).matches()) {
         return true;
-      } else if (p.endsWith("*")
-          && s.startsWith(p.substring(0, p.length() - 1))) {
+      } else if (p.endsWith("*") && s.startsWith(p.substring(0, p.length() - 1))) {
         return true;
       } else {
         if (p.equals(s)) {
diff --git a/src/main/java/com/googlesource/gerrit/plugins/uploadvalidator/ContentTypeValidator.java b/src/main/java/com/googlesource/gerrit/plugins/uploadvalidator/ContentTypeValidator.java
index f792cdb..eb1aa77 100644
--- a/src/main/java/com/googlesource/gerrit/plugins/uploadvalidator/ContentTypeValidator.java
+++ b/src/main/java/com/googlesource/gerrit/plugins/uploadvalidator/ContentTypeValidator.java
@@ -52,28 +52,36 @@
 
       @Override
       protected void configure() {
-        DynamicSet.bind(binder(), CommitValidationListener.class)
-            .to(ContentTypeValidator.class);
+        DynamicSet.bind(binder(), CommitValidationListener.class).to(ContentTypeValidator.class);
         bind(ProjectConfigEntry.class)
             .annotatedWith(Exports.named(KEY_BLOCKED_CONTENT_TYPE))
-            .toInstance(new ProjectConfigEntry("Blocked Content Type", null,
-                ProjectConfigEntryType.ARRAY, null, false,
-                "Pushes of commits that contain files with blocked content "
-                    + "types will be rejected."));
+            .toInstance(
+                new ProjectConfigEntry(
+                    "Blocked Content Type",
+                    null,
+                    ProjectConfigEntryType.ARRAY,
+                    null,
+                    false,
+                    "Pushes of commits that contain files with blocked content "
+                        + "types will be rejected."));
         bind(ProjectConfigEntry.class)
             .annotatedWith(Exports.named(KEY_BLOCKED_CONTENT_TYPE_WHITELIST))
-            .toInstance(new ProjectConfigEntry("Blocked Content Type Whitelist",
-                "false", ProjectConfigEntryType.BOOLEAN, null, false,
-                "If this option is checked, the entered content types are "
-                    + "interpreted as a whitelist. Otherwise commits that "
-                    + "contain one of these content types will be rejected."));
+            .toInstance(
+                new ProjectConfigEntry(
+                    "Blocked Content Type Whitelist",
+                    "false",
+                    ProjectConfigEntryType.BOOLEAN,
+                    null,
+                    false,
+                    "If this option is checked, the entered content types are "
+                        + "interpreted as a whitelist. Otherwise commits that "
+                        + "contain one of these content types will be rejected."));
       }
     };
   }
 
   public static final String KEY_BLOCKED_CONTENT_TYPE = "blockedContentType";
-  public static final String KEY_BLOCKED_CONTENT_TYPE_WHITELIST =
-      "blockedContentTypeWhitelist";
+  public static final String KEY_BLOCKED_CONTENT_TYPE_WHITELIST = "blockedContentTypeWhitelist";
 
   @VisibleForTesting
   static boolean isWhitelist(PluginConfig cfg) {
@@ -96,7 +104,8 @@
   private final ValidatorConfig validatorConfig;
 
   @Inject
-  ContentTypeValidator(@PluginName String pluginName,
+  ContentTypeValidator(
+      @PluginName String pluginName,
       ContentTypeUtil contentTypeUtil,
       PluginConfigFactory cfgFactory,
       GitRepositoryManager repoManager,
@@ -109,24 +118,28 @@
   }
 
   @Override
-  public List<CommitValidationMessage> onCommitReceived(
-      CommitReceivedEvent receiveEvent) throws CommitValidationException {
+  public List<CommitValidationMessage> onCommitReceived(CommitReceivedEvent receiveEvent)
+      throws CommitValidationException {
     try {
-      PluginConfig cfg = cfgFactory
-          .getFromProjectConfigWithInheritance(
+      PluginConfig cfg =
+          cfgFactory.getFromProjectConfigWithInheritance(
               receiveEvent.project.getNameKey(), pluginName);
       if (isActive(cfg)
-          && validatorConfig.isEnabledForRef(receiveEvent.user,
-              receiveEvent.getProjectNameKey(), receiveEvent.getRefName(),
+          && validatorConfig.isEnabledForRef(
+              receiveEvent.user,
+              receiveEvent.getProjectNameKey(),
+              receiveEvent.getRefName(),
               KEY_BLOCKED_CONTENT_TYPE)) {
-        try (Repository repo =
-            repoManager.openRepository(receiveEvent.project.getNameKey())) {
+        try (Repository repo = repoManager.openRepository(receiveEvent.project.getNameKey())) {
           List<CommitValidationMessage> messages =
-              performValidation(repo, receiveEvent.commit, receiveEvent.revWalk, getBlockedTypes(cfg),
+              performValidation(
+                  repo,
+                  receiveEvent.commit,
+                  receiveEvent.revWalk,
+                  getBlockedTypes(cfg),
                   isWhitelist(cfg));
           if (!messages.isEmpty()) {
-            throw new CommitValidationException("contains blocked content type",
-                messages);
+            throw new CommitValidationException("contains blocked content type", messages);
           }
         }
       }
@@ -137,8 +150,8 @@
   }
 
   @VisibleForTesting
-  List<CommitValidationMessage> performValidation(Repository repo,
-      RevCommit c, RevWalk revWalk, String[] blockedTypes, boolean whitelist)
+  List<CommitValidationMessage> performValidation(
+      Repository repo, RevCommit c, RevWalk revWalk, String[] blockedTypes, boolean whitelist)
       throws IOException, ExecutionException {
     List<CommitValidationMessage> messages = new LinkedList<>();
     Map<String, ObjectId> content = CommitUtils.getChangedContent(repo, c, revWalk);
@@ -146,13 +159,11 @@
       ObjectLoader ol = repo.open(content.get(path));
       try (ObjectStream os = ol.openStream()) {
         String contentType = contentTypeUtil.getContentType(os, path);
-        if ((contentTypeUtil.matchesAny(contentType, blockedTypes)
-            && !whitelist)
-            || (!contentTypeUtil.matchesAny(contentType, blockedTypes)
-                && whitelist)) {
-          messages.add(new CommitValidationMessage(
-              "found blocked content type (" + contentType + ") in file: "
-                  + path, true));
+        if ((contentTypeUtil.matchesAny(contentType, blockedTypes) && !whitelist)
+            || (!contentTypeUtil.matchesAny(contentType, blockedTypes) && whitelist)) {
+          messages.add(
+              new CommitValidationMessage(
+                  "found blocked content type (" + contentType + ") in file: " + path, true));
         }
       }
     }
diff --git a/src/main/java/com/googlesource/gerrit/plugins/uploadvalidator/DuplicatePathnameValidator.java b/src/main/java/com/googlesource/gerrit/plugins/uploadvalidator/DuplicatePathnameValidator.java
index 2a80d38..450c05f 100644
--- a/src/main/java/com/googlesource/gerrit/plugins/uploadvalidator/DuplicatePathnameValidator.java
+++ b/src/main/java/com/googlesource/gerrit/plugins/uploadvalidator/DuplicatePathnameValidator.java
@@ -57,7 +57,8 @@
   public static AbstractModule module() {
     return new AbstractModule() {
       private List<String> getAvailableLocales() {
-        return Lists.transform(Arrays.asList(Locale.getAvailableLocales()),
+        return Lists.transform(
+            Arrays.asList(Locale.getAvailableLocales()),
             new Function<Locale, String>() {
               @Override
               public String apply(Locale input) {
@@ -72,25 +73,34 @@
             .to(DuplicatePathnameValidator.class);
         bind(ProjectConfigEntry.class)
             .annotatedWith(Exports.named(KEY_REJECT_DUPLICATE_PATHNAMES))
-            .toInstance(new ProjectConfigEntry("Reject Duplicate Pathnames",
-                null, ProjectConfigEntryType.BOOLEAN, null, false,
-                "Pushes of commits that contain duplicate pathnames, or that "
-                    + "contain duplicates of existing pathnames will be "
-                    + "rejected. Pathnames y and z are considered to be "
-                    + "duplicates if they are equal, case-insensitive."));
+            .toInstance(
+                new ProjectConfigEntry(
+                    "Reject Duplicate Pathnames",
+                    null,
+                    ProjectConfigEntryType.BOOLEAN,
+                    null,
+                    false,
+                    "Pushes of commits that contain duplicate pathnames, or that "
+                        + "contain duplicates of existing pathnames will be "
+                        + "rejected. Pathnames y and z are considered to be "
+                        + "duplicates if they are equal, case-insensitive."));
         bind(ProjectConfigEntry.class)
             .annotatedWith(Exports.named(KEY_REJECT_DUPLICATE_PATHNAMES_LOCALE))
-            .toInstance(new ProjectConfigEntry("Reject Duplicate Pathnames Locale",
-                "en", ProjectConfigEntryType.STRING, getAvailableLocales(), false,
-                "To avoid problems caused by comparing pathnames with different "
-                    + "locales it is possible to use a specific locale. The "
-                    + "default is English (en)."));
+            .toInstance(
+                new ProjectConfigEntry(
+                    "Reject Duplicate Pathnames Locale",
+                    "en",
+                    ProjectConfigEntryType.STRING,
+                    getAvailableLocales(),
+                    false,
+                    "To avoid problems caused by comparing pathnames with different "
+                        + "locales it is possible to use a specific locale. The "
+                        + "default is English (en)."));
       }
     };
   }
 
-  public static final String KEY_REJECT_DUPLICATE_PATHNAMES =
-      "rejectDuplicatePathnames";
+  public static final String KEY_REJECT_DUPLICATE_PATHNAMES = "rejectDuplicatePathnames";
   public static final String KEY_REJECT_DUPLICATE_PATHNAMES_LOCALE =
       "rejectDuplicatePathnamesLocale";
 
@@ -101,8 +111,7 @@
 
   @VisibleForTesting
   static Locale getLocale(PluginConfig cfg) {
-    return Locale.forLanguageTag(
-        cfg.getString(KEY_REJECT_DUPLICATE_PATHNAMES_LOCALE, "en"));
+    return Locale.forLanguageTag(cfg.getString(KEY_REJECT_DUPLICATE_PATHNAMES_LOCALE, "en"));
   }
 
   @VisibleForTesting
@@ -135,8 +144,7 @@
 
   @VisibleForTesting
   static CommitValidationMessage conflict(String f1, String f2) {
-    return new CommitValidationMessage(f1 + ": pathname conflicts with " + f2,
-        true);
+    return new CommitValidationMessage(f1 + ": pathname conflicts with " + f2, true);
   }
 
   private static boolean isDeleted(TreeWalk tw) {
@@ -156,8 +164,10 @@
   }
 
   @Inject
-  DuplicatePathnameValidator(@PluginName String pluginName,
-      PluginConfigFactory cfgFactory, GitRepositoryManager repoManager,
+  DuplicatePathnameValidator(
+      @PluginName String pluginName,
+      PluginConfigFactory cfgFactory,
+      GitRepositoryManager repoManager,
       ValidatorConfig validatorConfig) {
     this.pluginName = pluginName;
     this.cfgFactory = cfgFactory;
@@ -166,30 +176,29 @@
   }
 
   @Override
-  public List<CommitValidationMessage> onCommitReceived(
-      CommitReceivedEvent receiveEvent) throws CommitValidationException {
+  public List<CommitValidationMessage> onCommitReceived(CommitReceivedEvent receiveEvent)
+      throws CommitValidationException {
     try {
-      PluginConfig cfg = cfgFactory
-          .getFromProjectConfigWithInheritance(
+      PluginConfig cfg =
+          cfgFactory.getFromProjectConfigWithInheritance(
               receiveEvent.project.getNameKey(), pluginName);
       if (isActive(cfg)
-          && validatorConfig.isEnabledForRef(receiveEvent.user,
-              receiveEvent.getProjectNameKey(), receiveEvent.getRefName(),
+          && validatorConfig.isEnabledForRef(
+              receiveEvent.user,
+              receiveEvent.getProjectNameKey(),
+              receiveEvent.getRefName(),
               KEY_REJECT_DUPLICATE_PATHNAMES)) {
         locale = getLocale(cfg);
-        try (Repository repo =
-            repoManager.openRepository(receiveEvent.project.getNameKey())) {
+        try (Repository repo = repoManager.openRepository(receiveEvent.project.getNameKey())) {
           List<CommitValidationMessage> messages =
               performValidation(repo, receiveEvent.commit, receiveEvent.revWalk);
           if (!messages.isEmpty()) {
-            throw new CommitValidationException("contains duplicate pathnames",
-                messages);
+            throw new CommitValidationException("contains duplicate pathnames", messages);
           }
         }
       }
     } catch (NoSuchProjectException | IOException e) {
-      throw new CommitValidationException(
-          "failed to check for duplicate pathnames", e);
+      throw new CommitValidationException("failed to check for duplicate pathnames", e);
     }
     return Collections.emptyList();
   }
@@ -214,9 +223,8 @@
   }
 
   @VisibleForTesting
-  void checkForDuplicatesAgainstTheWholeTree(TreeWalk tw,
-      Set<String> changed, List<CommitValidationMessage> messages)
-          throws IOException {
+  void checkForDuplicatesAgainstTheWholeTree(
+      TreeWalk tw, Set<String> changed, List<CommitValidationMessage> messages) throws IOException {
     Map<String, String> all = allPaths(changed);
 
     while (tw.next()) {
@@ -240,8 +248,7 @@
     }
   }
 
-  private void checkForDuplicatesInSet(Set<String> files,
-      List<CommitValidationMessage> messages) {
+  private void checkForDuplicatesInSet(Set<String> files, List<CommitValidationMessage> messages) {
     Set<String> filesAndFolders = Sets.newHashSet(files);
     filesAndFolders.addAll(allParentFolders(files));
     Map<String, String> seen = new HashMap<>();
diff --git a/src/main/java/com/googlesource/gerrit/plugins/uploadvalidator/FileExtensionValidator.java b/src/main/java/com/googlesource/gerrit/plugins/uploadvalidator/FileExtensionValidator.java
index 3c0df3d..e3c4393 100644
--- a/src/main/java/com/googlesource/gerrit/plugins/uploadvalidator/FileExtensionValidator.java
+++ b/src/main/java/com/googlesource/gerrit/plugins/uploadvalidator/FileExtensionValidator.java
@@ -48,14 +48,18 @@
 
       @Override
       public void configure() {
-        DynamicSet.bind(binder(), CommitValidationListener.class)
-            .to(FileExtensionValidator.class);
+        DynamicSet.bind(binder(), CommitValidationListener.class).to(FileExtensionValidator.class);
         bind(ProjectConfigEntry.class)
             .annotatedWith(Exports.named(KEY_BLOCKED_FILE_EXTENSION))
-            .toInstance(new ProjectConfigEntry("Blocked File Extensions", null,
-                ProjectConfigEntryType.ARRAY, null, false,
-                "Forbidden file extensions. Pushes of commits that "
-                    + "contain files with these extensions will be rejected."));
+            .toInstance(
+                new ProjectConfigEntry(
+                    "Blocked File Extensions",
+                    null,
+                    ProjectConfigEntryType.ARRAY,
+                    null,
+                    false,
+                    "Forbidden file extensions. Pushes of commits that "
+                        + "contain files with these extensions will be rejected."));
       }
     };
   }
diff --git a/src/main/java/com/googlesource/gerrit/plugins/uploadvalidator/FooterValidator.java b/src/main/java/com/googlesource/gerrit/plugins/uploadvalidator/FooterValidator.java
index f4c5810..ac6b81a 100644
--- a/src/main/java/com/googlesource/gerrit/plugins/uploadvalidator/FooterValidator.java
+++ b/src/main/java/com/googlesource/gerrit/plugins/uploadvalidator/FooterValidator.java
@@ -46,14 +46,18 @@
 
       @Override
       protected void configure() {
-        DynamicSet.bind(binder(), CommitValidationListener.class)
-            .to(FooterValidator.class);
+        DynamicSet.bind(binder(), CommitValidationListener.class).to(FooterValidator.class);
         bind(ProjectConfigEntry.class)
             .annotatedWith(Exports.named(KEY_REQUIRED_FOOTER))
-            .toInstance(new ProjectConfigEntry("Required Footers", null,
-                ProjectConfigEntryType.ARRAY, null, false,
-                "Required footers. Pushes of commits that miss any"
-                    + " of the footers will be rejected."));
+            .toInstance(
+                new ProjectConfigEntry(
+                    "Required Footers",
+                    null,
+                    ProjectConfigEntryType.ARRAY,
+                    null,
+                    false,
+                    "Required footers. Pushes of commits that miss any"
+                        + " of the footers will be rejected."));
       }
     };
   }
@@ -65,7 +69,9 @@
   private final ValidatorConfig validatorConfig;
 
   @Inject
-  FooterValidator(@PluginName String pluginName, PluginConfigFactory cfgFactory,
+  FooterValidator(
+      @PluginName String pluginName,
+      PluginConfigFactory cfgFactory,
       ValidatorConfig validatorConfig) {
     this.pluginName = pluginName;
     this.cfgFactory = cfgFactory;
@@ -73,31 +79,35 @@
   }
 
   @Override
-  public List<CommitValidationMessage> onCommitReceived(
-      CommitReceivedEvent receiveEvent) throws CommitValidationException {
+  public List<CommitValidationMessage> onCommitReceived(CommitReceivedEvent receiveEvent)
+      throws CommitValidationException {
     try {
       PluginConfig cfg =
           cfgFactory.getFromProjectConfigWithInheritance(
               receiveEvent.project.getNameKey(), pluginName);
-      String[] requiredFooters =
-          cfg.getStringList(KEY_REQUIRED_FOOTER);
+      String[] requiredFooters = cfg.getStringList(KEY_REQUIRED_FOOTER);
       if (requiredFooters.length > 0
-          && validatorConfig.isEnabledForRef(receiveEvent.user,
-              receiveEvent.getProjectNameKey(), receiveEvent.getRefName(),
+          && validatorConfig.isEnabledForRef(
+              receiveEvent.user,
+              receiveEvent.getProjectNameKey(),
+              receiveEvent.getRefName(),
               KEY_REQUIRED_FOOTER)) {
         List<CommitValidationMessage> messages = new LinkedList<>();
-        Set<String> footers = FluentIterable.from(receiveEvent.commit.getFooterLines())
-            .transform(new Function<FooterLine, String>() {
-                @Override
-                public String apply(FooterLine f) {
-                    return f.getKey().toLowerCase(Locale.US);
-                }
-            })
-            .toSet();
+        Set<String> footers =
+            FluentIterable.from(receiveEvent.commit.getFooterLines())
+                .transform(
+                    new Function<FooterLine, String>() {
+                      @Override
+                      public String apply(FooterLine f) {
+                        return f.getKey().toLowerCase(Locale.US);
+                      }
+                    })
+                .toSet();
         for (int i = 0; i < requiredFooters.length; i++) {
           if (!footers.contains(requiredFooters[i].toLowerCase(Locale.US))) {
-            messages.add(new CommitValidationMessage(
-                "missing required footer: " + requiredFooters[i], true));
+            messages.add(
+                new CommitValidationMessage(
+                    "missing required footer: " + requiredFooters[i], true));
           }
         }
         if (!messages.isEmpty()) {
diff --git a/src/main/java/com/googlesource/gerrit/plugins/uploadvalidator/InvalidFilenameValidator.java b/src/main/java/com/googlesource/gerrit/plugins/uploadvalidator/InvalidFilenameValidator.java
index d0906ff..d1925c2 100644
--- a/src/main/java/com/googlesource/gerrit/plugins/uploadvalidator/InvalidFilenameValidator.java
+++ b/src/main/java/com/googlesource/gerrit/plugins/uploadvalidator/InvalidFilenameValidator.java
@@ -52,17 +52,21 @@
             .to(InvalidFilenameValidator.class);
         bind(ProjectConfigEntry.class)
             .annotatedWith(Exports.named(KEY_INVALID_FILENAME_PATTERN))
-            .toInstance(new ProjectConfigEntry("Invalid Filename Pattern", null,
-                ProjectConfigEntryType.ARRAY, null, false,
-                "Invalid filenames. Pushes of commits that contain filenames "
-                    + "which match one of these patterns will be rejected."));
+            .toInstance(
+                new ProjectConfigEntry(
+                    "Invalid Filename Pattern",
+                    null,
+                    ProjectConfigEntryType.ARRAY,
+                    null,
+                    false,
+                    "Invalid filenames. Pushes of commits that contain filenames "
+                        + "which match one of these patterns will be rejected."));
       }
     };
   }
 
   public static final String KEY_INVALID_FILENAME = "invalidFilename";
-  public static final String KEY_INVALID_FILENAME_PATTERN =
-      KEY_INVALID_FILENAME + "Pattern";
+  public static final String KEY_INVALID_FILENAME_PATTERN = KEY_INVALID_FILENAME + "Pattern";
 
   private final String pluginName;
   private final PluginConfigFactory cfgFactory;
@@ -70,8 +74,10 @@
   private final ValidatorConfig validatorConfig;
 
   @Inject
-  InvalidFilenameValidator(@PluginName String pluginName,
-      PluginConfigFactory cfgFactory, GitRepositoryManager repoManager,
+  InvalidFilenameValidator(
+      @PluginName String pluginName,
+      PluginConfigFactory cfgFactory,
+      GitRepositoryManager repoManager,
       ValidatorConfig validatorConfig) {
     this.pluginName = pluginName;
     this.cfgFactory = cfgFactory;
@@ -84,20 +90,24 @@
   }
 
   @Override
-  public List<CommitValidationMessage> onCommitReceived(
-      CommitReceivedEvent receiveEvent) throws CommitValidationException {
+  public List<CommitValidationMessage> onCommitReceived(CommitReceivedEvent receiveEvent)
+      throws CommitValidationException {
     try {
       PluginConfig cfg =
           cfgFactory.getFromProjectConfigWithInheritance(
               receiveEvent.project.getNameKey(), pluginName);
       if (isActive(cfg)
-          && validatorConfig.isEnabledForRef(receiveEvent.user,
-              receiveEvent.getProjectNameKey(), receiveEvent.getRefName(),
+          && validatorConfig.isEnabledForRef(
+              receiveEvent.user,
+              receiveEvent.getProjectNameKey(),
+              receiveEvent.getRefName(),
               KEY_INVALID_FILENAME)) {
-        try (Repository repo = repoManager.openRepository(
-            receiveEvent.project.getNameKey())) {
+        try (Repository repo = repoManager.openRepository(receiveEvent.project.getNameKey())) {
           List<CommitValidationMessage> messages =
-              performValidation(repo, receiveEvent.commit, receiveEvent.revWalk,
+              performValidation(
+                  repo,
+                  receiveEvent.commit,
+                  receiveEvent.revWalk,
                   cfg.getStringList(KEY_INVALID_FILENAME_PATTERN));
           if (!messages.isEmpty()) {
             throw new CommitValidationException(
@@ -106,14 +116,13 @@
         }
       }
     } catch (NoSuchProjectException | IOException e) {
-      throw new CommitValidationException(
-          "failed to check on invalid file names", e);
+      throw new CommitValidationException("failed to check on invalid file names", e);
     }
     return Collections.emptyList();
   }
 
-  static List<CommitValidationMessage> performValidation(Repository repo,
-      RevCommit c, RevWalk revWalk, String[] patterns) throws IOException {
+  static List<CommitValidationMessage> performValidation(
+      Repository repo, RevCommit c, RevWalk revWalk, String[] patterns) throws IOException {
     List<Pattern> invalidFilenamePatterns = new ArrayList<>();
     for (String s : patterns) {
       invalidFilenamePatterns.add(Pattern.compile(s));
@@ -122,8 +131,8 @@
     for (String file : CommitUtils.getChangedPaths(repo, c, revWalk)) {
       for (Pattern p : invalidFilenamePatterns) {
         if (p.matcher(file).find()) {
-          messages.add(new CommitValidationMessage(
-              "invalid characters found in filename: " + file, true));
+          messages.add(
+              new CommitValidationMessage("invalid characters found in filename: " + file, true));
           break;
         }
       }
diff --git a/src/main/java/com/googlesource/gerrit/plugins/uploadvalidator/InvalidLineEndingValidator.java b/src/main/java/com/googlesource/gerrit/plugins/uploadvalidator/InvalidLineEndingValidator.java
index e3c44f1..00dc478 100644
--- a/src/main/java/com/googlesource/gerrit/plugins/uploadvalidator/InvalidLineEndingValidator.java
+++ b/src/main/java/com/googlesource/gerrit/plugins/uploadvalidator/InvalidLineEndingValidator.java
@@ -56,19 +56,22 @@
         DynamicSet.bind(binder(), CommitValidationListener.class)
             .to(InvalidLineEndingValidator.class);
         bind(ProjectConfigEntry.class)
-            .annotatedWith(
-                Exports.named(KEY_CHECK_REJECT_WINDOWS_LINE_ENDINGS))
-            .toInstance(new ProjectConfigEntry("Reject Windows Line Endings",
-                "false", ProjectConfigEntryType.BOOLEAN, null, false,
-                "Windows line endings. Pushes of commits that include files "
-                    + "containing carriage return (CR) characters will be "
-                    + "rejected."));
+            .annotatedWith(Exports.named(KEY_CHECK_REJECT_WINDOWS_LINE_ENDINGS))
+            .toInstance(
+                new ProjectConfigEntry(
+                    "Reject Windows Line Endings",
+                    "false",
+                    ProjectConfigEntryType.BOOLEAN,
+                    null,
+                    false,
+                    "Windows line endings. Pushes of commits that include files "
+                        + "containing carriage return (CR) characters will be "
+                        + "rejected."));
       }
     };
   }
 
-  public static final String KEY_CHECK_REJECT_WINDOWS_LINE_ENDINGS =
-      "rejectWindowsLineEndings";
+  public static final String KEY_CHECK_REJECT_WINDOWS_LINE_ENDINGS = "rejectWindowsLineEndings";
 
   private final String pluginName;
   private final PluginConfigFactory cfgFactory;
@@ -77,7 +80,8 @@
   private final ValidatorConfig validatorConfig;
 
   @Inject
-  InvalidLineEndingValidator(@PluginName String pluginName,
+  InvalidLineEndingValidator(
+      @PluginName String pluginName,
       ContentTypeUtil contentTypeUtil,
       PluginConfigFactory cfgFactory,
       GitRepositoryManager repoManager,
@@ -94,18 +98,19 @@
   }
 
   @Override
-  public List<CommitValidationMessage> onCommitReceived(
-      CommitReceivedEvent receiveEvent) throws CommitValidationException {
+  public List<CommitValidationMessage> onCommitReceived(CommitReceivedEvent receiveEvent)
+      throws CommitValidationException {
     try {
       PluginConfig cfg =
           cfgFactory.getFromProjectConfigWithInheritance(
               receiveEvent.project.getNameKey(), pluginName);
       if (isActive(cfg)
-          && validatorConfig.isEnabledForRef(receiveEvent.user,
-              receiveEvent.getProjectNameKey(), receiveEvent.getRefName(),
+          && validatorConfig.isEnabledForRef(
+              receiveEvent.user,
+              receiveEvent.getProjectNameKey(),
+              receiveEvent.getRefName(),
               KEY_CHECK_REJECT_WINDOWS_LINE_ENDINGS)) {
-        try (Repository repo =
-            repoManager.openRepository(receiveEvent.project.getNameKey())) {
+        try (Repository repo = repoManager.openRepository(receiveEvent.project.getNameKey())) {
           List<CommitValidationMessage> messages =
               performValidation(repo, receiveEvent.commit, receiveEvent.revWalk, cfg);
           if (!messages.isEmpty()) {
@@ -115,15 +120,15 @@
         }
       }
     } catch (NoSuchProjectException | IOException | ExecutionException e) {
-      throw new CommitValidationException(
-          "failed to check on Windows line endings", e);
+      throw new CommitValidationException("failed to check on Windows line endings", e);
     }
     return Collections.emptyList();
   }
 
   @VisibleForTesting
-  List<CommitValidationMessage> performValidation(Repository repo, RevCommit c, RevWalk revWalk,
-      PluginConfig cfg) throws IOException, ExecutionException {
+  List<CommitValidationMessage> performValidation(
+      Repository repo, RevCommit c, RevWalk revWalk, PluginConfig cfg)
+      throws IOException, ExecutionException {
     List<CommitValidationMessage> messages = new LinkedList<>();
     Map<String, ObjectId> content = CommitUtils.getChangedContent(repo, c, revWalk);
     for (String path : content.keySet()) {
@@ -131,19 +136,18 @@
       if (contentTypeUtil.isBinary(ol, path, cfg)) {
         continue;
       }
-      try (InputStreamReader isr =
-          new InputStreamReader(ol.openStream(), StandardCharsets.UTF_8)) {
+      try (InputStreamReader isr = new InputStreamReader(ol.openStream(), StandardCharsets.UTF_8)) {
         if (doesInputStreanContainCR(isr)) {
-          messages.add(new CommitValidationMessage(
-              "found carriage return (CR) character in file: " + path, true));
+          messages.add(
+              new CommitValidationMessage(
+                  "found carriage return (CR) character in file: " + path, true));
         }
       }
     }
     return messages;
   }
 
-  private static boolean doesInputStreanContainCR(InputStreamReader isr)
-      throws IOException {
+  private static boolean doesInputStreanContainCR(InputStreamReader isr) throws IOException {
     char[] buffer = new char[1024];
     int n;
     while ((n = isr.read(buffer, 0, buffer.length)) > 0) {
diff --git a/src/main/java/com/googlesource/gerrit/plugins/uploadvalidator/MaxPathLengthValidator.java b/src/main/java/com/googlesource/gerrit/plugins/uploadvalidator/MaxPathLengthValidator.java
index 29aeba8..188ce09 100644
--- a/src/main/java/com/googlesource/gerrit/plugins/uploadvalidator/MaxPathLengthValidator.java
+++ b/src/main/java/com/googlesource/gerrit/plugins/uploadvalidator/MaxPathLengthValidator.java
@@ -45,14 +45,17 @@
 
       @Override
       protected void configure() {
-        DynamicSet.bind(binder(), CommitValidationListener.class)
-            .to(MaxPathLengthValidator.class);
+        DynamicSet.bind(binder(), CommitValidationListener.class).to(MaxPathLengthValidator.class);
         bind(ProjectConfigEntry.class)
             .annotatedWith(Exports.named(KEY_MAX_PATH_LENGTH))
-            .toInstance(new ProjectConfigEntry("Max Path Length", 0, false,
-                "Maximum path length. Pushes of commits that "
-                    + "contain files with longer paths will be rejected. "
-                    + "'0' means no limit."));
+            .toInstance(
+                new ProjectConfigEntry(
+                    "Max Path Length",
+                    0,
+                    false,
+                    "Maximum path length. Pushes of commits that "
+                        + "contain files with longer paths will be rejected. "
+                        + "'0' means no limit."));
       }
     };
   }
@@ -65,8 +68,10 @@
   private final ValidatorConfig validatorConfig;
 
   @Inject
-  MaxPathLengthValidator(@PluginName String pluginName,
-      PluginConfigFactory cfgFactory, GitRepositoryManager repoManager,
+  MaxPathLengthValidator(
+      @PluginName String pluginName,
+      PluginConfigFactory cfgFactory,
+      GitRepositoryManager repoManager,
       ValidatorConfig validatorConfig) {
     this.pluginName = pluginName;
     this.cfgFactory = cfgFactory;
@@ -79,37 +84,37 @@
   }
 
   @Override
-  public List<CommitValidationMessage> onCommitReceived(
-      CommitReceivedEvent receiveEvent) throws CommitValidationException {
+  public List<CommitValidationMessage> onCommitReceived(CommitReceivedEvent receiveEvent)
+      throws CommitValidationException {
     try {
       PluginConfig cfg =
           cfgFactory.getFromProjectConfigWithInheritance(
               receiveEvent.project.getNameKey(), pluginName);
       if (isActive(cfg)
-          && validatorConfig.isEnabledForRef(receiveEvent.user,
-              receiveEvent.getProjectNameKey(), receiveEvent.getRefName(),
+          && validatorConfig.isEnabledForRef(
+              receiveEvent.user,
+              receiveEvent.getProjectNameKey(),
+              receiveEvent.getRefName(),
               KEY_MAX_PATH_LENGTH)) {
         int maxPathLength = cfg.getInt(KEY_MAX_PATH_LENGTH, 0);
-        try (Repository repo =
-            repoManager.openRepository(receiveEvent.project.getNameKey())) {
+        try (Repository repo = repoManager.openRepository(receiveEvent.project.getNameKey())) {
           List<CommitValidationMessage> messages =
               performValidation(repo, receiveEvent.commit, receiveEvent.revWalk, maxPathLength);
           if (!messages.isEmpty()) {
             throw new CommitValidationException(
-                "contains files with too long paths (max path length: "
-                    + maxPathLength + ")", messages);
+                "contains files with too long paths (max path length: " + maxPathLength + ")",
+                messages);
           }
         }
       }
     } catch (NoSuchProjectException | IOException e) {
-      throw new CommitValidationException(
-          "failed to check for max file path length", e);
+      throw new CommitValidationException("failed to check for max file path length", e);
     }
     return Collections.emptyList();
   }
 
-  static List<CommitValidationMessage> performValidation(Repository repo,
-      RevCommit c, RevWalk revWalk, int maxPathLength) throws IOException {
+  static List<CommitValidationMessage> performValidation(
+      Repository repo, RevCommit c, RevWalk revWalk, int maxPathLength) throws IOException {
     List<CommitValidationMessage> messages = new LinkedList<>();
     for (String file : CommitUtils.getChangedPaths(repo, c, revWalk)) {
       if (file.length() > maxPathLength) {
diff --git a/src/main/java/com/googlesource/gerrit/plugins/uploadvalidator/Module.java b/src/main/java/com/googlesource/gerrit/plugins/uploadvalidator/Module.java
index b605165..5b6677a 100644
--- a/src/main/java/com/googlesource/gerrit/plugins/uploadvalidator/Module.java
+++ b/src/main/java/com/googlesource/gerrit/plugins/uploadvalidator/Module.java
@@ -36,7 +36,6 @@
     install(DuplicatePathnameValidator.module());
     install(ValidatorConfig.module());
 
-    bind(ConfigFactory.class).to(PluginConfigWithInheritanceFactory.class).in(
-        Scopes.SINGLETON);
+    bind(ConfigFactory.class).to(PluginConfigWithInheritanceFactory.class).in(Scopes.SINGLETON);
   }
 }
diff --git a/src/main/java/com/googlesource/gerrit/plugins/uploadvalidator/PluginConfigWithInheritanceFactory.java b/src/main/java/com/googlesource/gerrit/plugins/uploadvalidator/PluginConfigWithInheritanceFactory.java
index 1e90f2c..1e748b4 100644
--- a/src/main/java/com/googlesource/gerrit/plugins/uploadvalidator/PluginConfigWithInheritanceFactory.java
+++ b/src/main/java/com/googlesource/gerrit/plugins/uploadvalidator/PluginConfigWithInheritanceFactory.java
@@ -25,13 +25,13 @@
 import org.slf4j.LoggerFactory;
 
 public class PluginConfigWithInheritanceFactory implements ConfigFactory {
-  private static final Logger log = LoggerFactory.getLogger(PluginConfigWithInheritanceFactory.class);
+  private static final Logger log =
+      LoggerFactory.getLogger(PluginConfigWithInheritanceFactory.class);
   private final PluginConfigFactory pluginConfigFactory;
   private final String pluginName;
 
   @Inject
-  public PluginConfigWithInheritanceFactory(PluginConfigFactory pcf,
-      @PluginName String pn) {
+  public PluginConfigWithInheritanceFactory(PluginConfigFactory pcf, @PluginName String pn) {
     this.pluginConfigFactory = pcf;
     this.pluginName = pn;
   }
@@ -39,8 +39,7 @@
   @Override
   public PluginConfig get(Project.NameKey projectName) {
     try {
-      return pluginConfigFactory.getFromProjectConfigWithInheritance(projectName,
-          pluginName);
+      return pluginConfigFactory.getFromProjectConfigWithInheritance(projectName, pluginName);
     } catch (NoSuchProjectException e) {
       log.warn(projectName.get() + " not found");
       return null;
diff --git a/src/main/java/com/googlesource/gerrit/plugins/uploadvalidator/SubmoduleValidator.java b/src/main/java/com/googlesource/gerrit/plugins/uploadvalidator/SubmoduleValidator.java
index 88c8f62..82b9ad0 100644
--- a/src/main/java/com/googlesource/gerrit/plugins/uploadvalidator/SubmoduleValidator.java
+++ b/src/main/java/com/googlesource/gerrit/plugins/uploadvalidator/SubmoduleValidator.java
@@ -48,13 +48,17 @@
 
       @Override
       protected void configure() {
-        DynamicSet.bind(binder(), CommitValidationListener.class)
-            .to(SubmoduleValidator.class);
+        DynamicSet.bind(binder(), CommitValidationListener.class).to(SubmoduleValidator.class);
         bind(ProjectConfigEntry.class)
             .annotatedWith(Exports.named(KEY_CHECK_SUBMODULE))
-            .toInstance(new ProjectConfigEntry("Reject Submodules", "false",
-                ProjectConfigEntryType.BOOLEAN, null, false, "Pushes of "
-                    + "commits that include submodules will be rejected."));
+            .toInstance(
+                new ProjectConfigEntry(
+                    "Reject Submodules",
+                    "false",
+                    ProjectConfigEntryType.BOOLEAN,
+                    null,
+                    false,
+                    "Pushes of " + "commits that include submodules will be rejected."));
       }
     };
   }
@@ -67,8 +71,10 @@
   private final ValidatorConfig validatorConfig;
 
   @Inject
-  SubmoduleValidator(@PluginName String pluginName,
-      PluginConfigFactory cfgFactory, GitRepositoryManager repoManager,
+  SubmoduleValidator(
+      @PluginName String pluginName,
+      PluginConfigFactory cfgFactory,
+      GitRepositoryManager repoManager,
       ValidatorConfig validatorConfig) {
     this.pluginName = pluginName;
     this.cfgFactory = cfgFactory;
@@ -81,18 +87,19 @@
   }
 
   @Override
-  public List<CommitValidationMessage> onCommitReceived(
-      CommitReceivedEvent receiveEvent) throws CommitValidationException {
+  public List<CommitValidationMessage> onCommitReceived(CommitReceivedEvent receiveEvent)
+      throws CommitValidationException {
     try {
-      PluginConfig cfg = cfgFactory
-          .getFromProjectConfigWithInheritance(
+      PluginConfig cfg =
+          cfgFactory.getFromProjectConfigWithInheritance(
               receiveEvent.project.getNameKey(), pluginName);
       if (isActive(cfg)
-          && validatorConfig.isEnabledForRef(receiveEvent.user,
-              receiveEvent.getProjectNameKey(), receiveEvent.getRefName(),
+          && validatorConfig.isEnabledForRef(
+              receiveEvent.user,
+              receiveEvent.getProjectNameKey(),
+              receiveEvent.getRefName(),
               KEY_CHECK_SUBMODULE)) {
-        try (Repository repo =
-            repoManager.openRepository(receiveEvent.project.getNameKey())) {
+        try (Repository repo = repoManager.openRepository(receiveEvent.project.getNameKey())) {
           List<CommitValidationMessage> messages =
               performValidation(repo, receiveEvent.commit, receiveEvent.revWalk);
           if (!messages.isEmpty()) {
@@ -106,28 +113,31 @@
     return Collections.emptyList();
   }
 
-  private static void addValidationMessage(
-      List<CommitValidationMessage> messages, TreeWalk tw) {
-    messages.add(new CommitValidationMessage(
-        "submodules are not allowed: " + tw.getPathString(), true));
+  private static void addValidationMessage(List<CommitValidationMessage> messages, TreeWalk tw) {
+    messages.add(
+        new CommitValidationMessage("submodules are not allowed: " + tw.getPathString(), true));
   }
 
   private static boolean isSubmodule(TreeWalk tw) {
     return (tw.getRawMode(0) & FileMode.TYPE_MASK) == FileMode.TYPE_GITLINK;
   }
 
-  static List<CommitValidationMessage> performValidation(Repository repo,
-      RevCommit c, RevWalk revWalk) throws IOException {
+  static List<CommitValidationMessage> performValidation(
+      Repository repo, RevCommit c, RevWalk revWalk) throws IOException {
     final List<CommitValidationMessage> messages = new LinkedList<>();
 
-    CommitUtils.visitChangedEntries(repo, c, revWalk, new TreeWalkVisitor() {
-      @Override
-      public void onVisit(TreeWalk tw) {
-        if (isSubmodule(tw)) {
-          addValidationMessage(messages, tw);
-        }
-      }
-    });
+    CommitUtils.visitChangedEntries(
+        repo,
+        c,
+        revWalk,
+        new TreeWalkVisitor() {
+          @Override
+          public void onVisit(TreeWalk tw) {
+            if (isSubmodule(tw)) {
+              addValidationMessage(messages, tw);
+            }
+          }
+        });
     return messages;
   }
 }
diff --git a/src/main/java/com/googlesource/gerrit/plugins/uploadvalidator/SymlinkValidator.java b/src/main/java/com/googlesource/gerrit/plugins/uploadvalidator/SymlinkValidator.java
index 381cc7b..b7ec041 100644
--- a/src/main/java/com/googlesource/gerrit/plugins/uploadvalidator/SymlinkValidator.java
+++ b/src/main/java/com/googlesource/gerrit/plugins/uploadvalidator/SymlinkValidator.java
@@ -48,14 +48,18 @@
 
       @Override
       protected void configure() {
-        DynamicSet.bind(binder(), CommitValidationListener.class)
-            .to(SymlinkValidator.class);
+        DynamicSet.bind(binder(), CommitValidationListener.class).to(SymlinkValidator.class);
         bind(ProjectConfigEntry.class)
             .annotatedWith(Exports.named(KEY_CHECK_SYMLINK))
-            .toInstance(new ProjectConfigEntry("Reject Symbolic Links", "false",
-                ProjectConfigEntryType.BOOLEAN, null, false,
-                "Symbolic Links. Pushes of commits that include symbolic "
-                    + "links will be rejected."));
+            .toInstance(
+                new ProjectConfigEntry(
+                    "Reject Symbolic Links",
+                    "false",
+                    ProjectConfigEntryType.BOOLEAN,
+                    null,
+                    false,
+                    "Symbolic Links. Pushes of commits that include symbolic "
+                        + "links will be rejected."));
       }
     };
   }
@@ -68,8 +72,10 @@
   private final ValidatorConfig validatorConfig;
 
   @Inject
-  SymlinkValidator(@PluginName String pluginName,
-      PluginConfigFactory cfgFactory, GitRepositoryManager repoManager,
+  SymlinkValidator(
+      @PluginName String pluginName,
+      PluginConfigFactory cfgFactory,
+      GitRepositoryManager repoManager,
       ValidatorConfig validatorConfig) {
     this.pluginName = pluginName;
     this.cfgFactory = cfgFactory;
@@ -82,56 +88,57 @@
   }
 
   @Override
-  public List<CommitValidationMessage> onCommitReceived(
-      CommitReceivedEvent receiveEvent) throws CommitValidationException {
+  public List<CommitValidationMessage> onCommitReceived(CommitReceivedEvent receiveEvent)
+      throws CommitValidationException {
     try {
       PluginConfig cfg =
           cfgFactory.getFromProjectConfigWithInheritance(
               receiveEvent.project.getNameKey(), pluginName);
       if (isActive(cfg)
-          && validatorConfig.isEnabledForRef(receiveEvent.user,
-              receiveEvent.getProjectNameKey(), receiveEvent.getRefName(),
+          && validatorConfig.isEnabledForRef(
+              receiveEvent.user,
+              receiveEvent.getProjectNameKey(),
+              receiveEvent.getRefName(),
               KEY_CHECK_SYMLINK)) {
-        try (Repository repo =
-            repoManager.openRepository(receiveEvent.project.getNameKey())) {
+        try (Repository repo = repoManager.openRepository(receiveEvent.project.getNameKey())) {
           List<CommitValidationMessage> messages =
               performValidation(repo, receiveEvent.commit, receiveEvent.revWalk);
           if (!messages.isEmpty()) {
-            throw new CommitValidationException("contains symbolic links",
-                messages);
+            throw new CommitValidationException("contains symbolic links", messages);
           }
         }
       }
     } catch (NoSuchProjectException | IOException e) {
-      throw new CommitValidationException(
-          "failed to check on symbolic links", e);
+      throw new CommitValidationException("failed to check on symbolic links", e);
     }
     return Collections.emptyList();
   }
 
-  private static void addValidationMessage(
-      List<CommitValidationMessage> messages, TreeWalk tw) {
-    messages.add(new CommitValidationMessage(
-        "Symbolic links are not allowed: "
-        + tw.getPathString(), true));
+  private static void addValidationMessage(List<CommitValidationMessage> messages, TreeWalk tw) {
+    messages.add(
+        new CommitValidationMessage("Symbolic links are not allowed: " + tw.getPathString(), true));
   }
 
   private static boolean isSymLink(TreeWalk tw) {
     return (tw.getRawMode(0) & FileMode.TYPE_MASK) == FileMode.TYPE_SYMLINK;
   }
 
-  static List<CommitValidationMessage> performValidation(Repository repo,
-      RevCommit c, RevWalk revWalk) throws IOException {
+  static List<CommitValidationMessage> performValidation(
+      Repository repo, RevCommit c, RevWalk revWalk) throws IOException {
     final List<CommitValidationMessage> messages = new LinkedList<>();
 
-    CommitUtils.visitChangedEntries(repo, c, revWalk, new TreeWalkVisitor() {
-      @Override
-      public void onVisit(TreeWalk tw) {
-        if (isSymLink(tw)) {
-          addValidationMessage(messages, tw);
-        }
-      }
-    });
+    CommitUtils.visitChangedEntries(
+        repo,
+        c,
+        revWalk,
+        new TreeWalkVisitor() {
+          @Override
+          public void onVisit(TreeWalk tw) {
+            if (isSymLink(tw)) {
+              addValidationMessage(messages, tw);
+            }
+          }
+        });
     return messages;
   }
 }
diff --git a/src/main/java/com/googlesource/gerrit/plugins/uploadvalidator/TreeWalkVisitor.java b/src/main/java/com/googlesource/gerrit/plugins/uploadvalidator/TreeWalkVisitor.java
index 3386fda..9a6de33 100644
--- a/src/main/java/com/googlesource/gerrit/plugins/uploadvalidator/TreeWalkVisitor.java
+++ b/src/main/java/com/googlesource/gerrit/plugins/uploadvalidator/TreeWalkVisitor.java
@@ -19,5 +19,4 @@
 public interface TreeWalkVisitor {
 
   void onVisit(TreeWalk tw);
-
 }
diff --git a/src/main/java/com/googlesource/gerrit/plugins/uploadvalidator/ValidatorConfig.java b/src/main/java/com/googlesource/gerrit/plugins/uploadvalidator/ValidatorConfig.java
index 30227fc..2770f00 100644
--- a/src/main/java/com/googlesource/gerrit/plugins/uploadvalidator/ValidatorConfig.java
+++ b/src/main/java/com/googlesource/gerrit/plugins/uploadvalidator/ValidatorConfig.java
@@ -35,8 +35,7 @@
 import java.util.stream.Stream;
 
 public class ValidatorConfig {
-  private static final Logger log = LoggerFactory
-      .getLogger(ValidatorConfig.class);
+  private static final Logger log = LoggerFactory.getLogger(ValidatorConfig.class);
   private static final String KEY_PROJECT = "project";
   private static final String KEY_REF = "ref";
   private final ConfigFactory configFactory;
@@ -48,27 +47,36 @@
       protected void configure() {
         bind(ProjectConfigEntry.class)
             .annotatedWith(Exports.named(KEY_PROJECT))
-            .toInstance(new ProjectConfigEntry("Projects", null,
-                ProjectConfigEntryType.ARRAY, null, false,
-                "Only projects that match this regex will be validated."));
+            .toInstance(
+                new ProjectConfigEntry(
+                    "Projects",
+                    null,
+                    ProjectConfigEntryType.ARRAY,
+                    null,
+                    false,
+                    "Only projects that match this regex will be validated."));
         bind(ProjectConfigEntry.class)
             .annotatedWith(Exports.named(KEY_REF))
-            .toInstance(new ProjectConfigEntry("Refs", null,
-                ProjectConfigEntryType.ARRAY, null, false,
-                "Only refs that match this regex will be validated."));
+            .toInstance(
+                new ProjectConfigEntry(
+                    "Refs",
+                    null,
+                    ProjectConfigEntryType.ARRAY,
+                    null,
+                    false,
+                    "Only refs that match this regex will be validated."));
       }
     };
   }
 
   @Inject
-  public ValidatorConfig(ConfigFactory configFactory,
-      GroupCache groupCache) {
+  public ValidatorConfig(ConfigFactory configFactory, GroupCache groupCache) {
     this.configFactory = configFactory;
     this.groupCache = groupCache;
   }
 
-  public boolean isEnabledForRef(IdentifiedUser user,
-      Project.NameKey projectName, String refName, String validatorOp) {
+  public boolean isEnabledForRef(
+      IdentifiedUser user, Project.NameKey projectName, String refName, String validatorOp) {
     PluginConfig conf = configFactory.get(projectName);
 
     return conf != null
@@ -87,14 +95,16 @@
         && hasValidConfigRef(config, "skipRef", projectName);
   }
 
-  private boolean hasValidConfigRef(PluginConfig config, String refKey,
-      Project.NameKey projectName) {
+  private boolean hasValidConfigRef(
+      PluginConfig config, String refKey, Project.NameKey projectName) {
     boolean valid = true;
     for (String refPattern : config.getStringList(refKey)) {
       if (!RefConfigSection.isValid(refPattern)) {
         log.error(
             "Invalid {} name/pattern/regex '{}' in {} project's plugin config",
-            refKey, refPattern, projectName.get());
+            refKey,
+            refPattern,
+            projectName.get());
         valid = false;
       }
     }
@@ -125,12 +135,11 @@
     return matchCriteria(config, "skipRef", ref, true, true);
   }
 
-  private boolean matchCriteria(PluginConfig config, String criteria,
-      String value, boolean allowRegex, boolean refMatcher) {
+  private boolean matchCriteria(
+      PluginConfig config, String criteria, String value, boolean allowRegex, boolean refMatcher) {
     boolean match = true;
     for (String s : config.getStringList(criteria)) {
-      if ((allowRegex && match(value, s, refMatcher)) ||
-          (!allowRegex && s.equals(value))) {
+      if ((allowRegex && match(value, s, refMatcher)) || (!allowRegex && s.equals(value))) {
         return true;
       }
       match = false;
@@ -138,8 +147,7 @@
     return match;
   }
 
-  private static boolean match(String value, String pattern,
-      boolean refMatcher) {
+  private static boolean match(String value, String pattern, boolean refMatcher) {
     if (refMatcher) {
       return RefPatternMatcher.getMatcher(pattern).match(value, null);
     } else {
@@ -154,13 +162,11 @@
 
     Stream<AccountGroup.UUID> skipGroups =
         Arrays.stream(conf.getStringList("skipGroup")).map(this::groupUUID);
-    return user.asIdentifiedUser().getEffectiveGroups()
-        .containsAnyOf(skipGroups::iterator);
+    return user.asIdentifiedUser().getEffectiveGroups().containsAnyOf(skipGroups::iterator);
   }
 
   private AccountGroup.UUID groupUUID(String groupNameOrUUID) {
-    AccountGroup group =
-        groupCache.get(new AccountGroup.NameKey(groupNameOrUUID));
+    AccountGroup group = groupCache.get(new AccountGroup.NameKey(groupNameOrUUID));
     if (group == null) {
       return new AccountGroup.UUID(groupNameOrUUID);
     }
diff --git a/src/test/java/com/googlesource/gerrit/plugins/uploadvalidator/BlockedKeywordValidatorTest.java b/src/test/java/com/googlesource/gerrit/plugins/uploadvalidator/BlockedKeywordValidatorTest.java
index 2ec5dd7..6a178f0 100644
--- a/src/test/java/com/googlesource/gerrit/plugins/uploadvalidator/BlockedKeywordValidatorTest.java
+++ b/src/test/java/com/googlesource/gerrit/plugins/uploadvalidator/BlockedKeywordValidatorTest.java
@@ -39,11 +39,10 @@
 
 public class BlockedKeywordValidatorTest extends ValidatorTestCase {
   private static ImmutableMap<String, Pattern> getPatterns() {
-    return ImmutableMap.<String, Pattern> builder()
+    return ImmutableMap.<String, Pattern>builder()
         .put("myp4ssw0rd", Pattern.compile("myp4ssw0rd"))
         .put("foobar", Pattern.compile("foobar"))
-        .put("\\$(Id|Header):[^$]*\\$",
-            Pattern.compile("\\$(Id|Header):[^$]*\\$"))
+        .put("\\$(Id|Header):[^$]*\\$", Pattern.compile("\\$(Id|Header):[^$]*\\$"))
         .build();
   }
 
@@ -51,23 +50,24 @@
     Map<File, byte[]> files = new HashMap<>();
     // invalid files
     String content = "http://foo.bar.tld/?pw=myp4ssw0rdTefoobarstline2\n";
-    files.put(new File(repo.getDirectory().getParent(), "foo.txt"),
+    files.put(
+        new File(repo.getDirectory().getParent(), "foo.txt"),
         content.getBytes(StandardCharsets.UTF_8));
 
-    content = "$Id$\n"
-        + "$Header$\n"
-        + "$Author$\n"
-        + "processXFile($File::Find::name, $Config{$type});\n"
-        + "$Id: foo bar$\n";
-    files.put(new File(repo.getDirectory().getParent(), "bar.txt"),
+    content =
+        "$Id$\n"
+            + "$Header$\n"
+            + "$Author$\n"
+            + "processXFile($File::Find::name, $Config{$type});\n"
+            + "$Id: foo bar$\n";
+    files.put(
+        new File(repo.getDirectory().getParent(), "bar.txt"),
         content.getBytes(StandardCharsets.UTF_8));
 
     // valid file
-    content = "Testline1\n"
-        + "Testline2\n"
-        + "Testline3\n"
-        + "Testline4";
-    files.put(new File(repo.getDirectory().getParent(), "foobar.txt"),
+    content = "Testline1\n" + "Testline2\n" + "Testline3\n" + "Testline4";
+    files.put(
+        new File(repo.getDirectory().getParent(), "foobar.txt"),
         content.getBytes(StandardCharsets.UTF_8));
     return TestUtils.makeCommit(rw, repo, "Commit foobar with test files.", files);
   }
@@ -76,19 +76,20 @@
   public void testKeywords() throws Exception {
     try (RevWalk rw = new RevWalk(repo)) {
       RevCommit c = makeCommit(rw);
-      BlockedKeywordValidator validator = new BlockedKeywordValidator(null,
-          new ContentTypeUtil(PATTERN_CACHE), PATTERN_CACHE, null, null, null);
-      List<CommitValidationMessage> m = validator.performValidation(
-          repo, c, rw, getPatterns().values(), EMPTY_PLUGIN_CONFIG);
-      Set<String> expected = ImmutableSet.of(
-          "ERROR: blocked keyword(s) found in: foo.txt (Line: 1)"
-              + " (found: myp4ssw0rd, foobar)",
-          "ERROR: blocked keyword(s) found in: bar.txt (Line: 5)"
-              + " (found: $Id: foo bar$)",
-          "ERROR: blocked keyword(s) found in: " + Patch.COMMIT_MSG
-              + " (Line: 1) (found: foobar)");
-      assertThat(TestUtils.transformMessages(m))
-          .containsExactlyElementsIn(expected);
+      BlockedKeywordValidator validator =
+          new BlockedKeywordValidator(
+              null, new ContentTypeUtil(PATTERN_CACHE), PATTERN_CACHE, null, null, null);
+      List<CommitValidationMessage> m =
+          validator.performValidation(repo, c, rw, getPatterns().values(), EMPTY_PLUGIN_CONFIG);
+      Set<String> expected =
+          ImmutableSet.of(
+              "ERROR: blocked keyword(s) found in: foo.txt (Line: 1)"
+                  + " (found: myp4ssw0rd, foobar)",
+              "ERROR: blocked keyword(s) found in: bar.txt (Line: 5)" + " (found: $Id: foo bar$)",
+              "ERROR: blocked keyword(s) found in: "
+                  + Patch.COMMIT_MSG
+                  + " (Line: 1) (found: foobar)");
+      assertThat(TestUtils.transformMessages(m)).containsExactlyElementsIn(expected);
     }
   }
 
diff --git a/src/test/java/com/googlesource/gerrit/plugins/uploadvalidator/ContentTypeUtilTest.java b/src/test/java/com/googlesource/gerrit/plugins/uploadvalidator/ContentTypeUtilTest.java
index 47c6106..5e232e4 100644
--- a/src/test/java/com/googlesource/gerrit/plugins/uploadvalidator/ContentTypeUtilTest.java
+++ b/src/test/java/com/googlesource/gerrit/plugins/uploadvalidator/ContentTypeUtilTest.java
@@ -33,8 +33,7 @@
 
   @Test
   public void testMatchesAny() throws ExecutionException {
-    String[] patterns =
-        new String[] {"text/*", "^application/(pdf|xml)", "application/zip"};
+    String[] patterns = new String[] {"text/*", "^application/(pdf|xml)", "application/zip"};
 
     matchesAny("text/xml", patterns);
     matchesAny("text/html", patterns);
@@ -47,13 +46,11 @@
     noMatch("application/msword", patterns);
   }
 
-  private void matchesAny(String p, String[] patterns)
-      throws ExecutionException {
+  private void matchesAny(String p, String[] patterns) throws ExecutionException {
     assertThat(ctu.matchesAny(p, patterns)).isTrue();
   }
 
-  private void noMatch(String p, String[] patterns)
-      throws ExecutionException {
+  private void noMatch(String p, String[] patterns) throws ExecutionException {
     assertThat(ctu.matchesAny(p, patterns)).isFalse();
   }
 
diff --git a/src/test/java/com/googlesource/gerrit/plugins/uploadvalidator/ContentTypeValidatorTest.java b/src/test/java/com/googlesource/gerrit/plugins/uploadvalidator/ContentTypeValidatorTest.java
index 75f1b07..5d6dfad 100644
--- a/src/test/java/com/googlesource/gerrit/plugins/uploadvalidator/ContentTypeValidatorTest.java
+++ b/src/test/java/com/googlesource/gerrit/plugins/uploadvalidator/ContentTypeValidatorTest.java
@@ -35,44 +35,48 @@
 
 public class ContentTypeValidatorTest extends ValidatorTestCase {
 
-  private static final byte[] TEST_PDF = ("%PDF-1.4\n"
-        + "1 0 obj << /Type /Catalog /Outlines 2 0 R /Pages 3 0 R >>\n"
-        + "endobj 2 0 obj << /Type /Outlines /Count 0 >>\n"
-        + "endobj 3 0 obj << /Type /Pages /Kids [4 0 R] /Count 1\n"
-        + ">> endobj 4 0 obj << /Type /Page /Parent 3 0 R\n"
-        + "/MediaBox [0 0 612 144] /Contents 5 0 R /Resources << /ProcSet 6 0 R\n"
-        + "/Font << /F1 7 0 R >> >> >> endobj 5 0 obj\n"
-        + "<< /Length 73 >> stream BT\n" + "/F1 24 Tf\n" + "100 100 Td\n"
-        + "(Small pdf) Tj\n"
-        + "ET endstream endobj 6 0 obj [/PDF /Text] endobj 7 0 obj\n"
-        + "<< /Type /Font /Subtype /Type1 /Name /F1 /BaseFont /Helvetica\n"
-        + "/Encoding /MacRomanEncoding >> endobj xref 0 8\n"
-        + "0000000000 65535 f 0000000009 00000 n 0000000074 00000 n\n"
-        + "0000000120 00000 n 0000000179 00000 n 0000000364 00000 n\n"
-        + "0000000466 00000 n 0000000496 00000 n\n"
-        + "trailer << /Size 8 /Root 1 0 R >> startxref 625\n" + "%%EOF")
-        .getBytes(StandardCharsets.UTF_8);
+  private static final byte[] TEST_PDF =
+      ("%PDF-1.4\n"
+              + "1 0 obj << /Type /Catalog /Outlines 2 0 R /Pages 3 0 R >>\n"
+              + "endobj 2 0 obj << /Type /Outlines /Count 0 >>\n"
+              + "endobj 3 0 obj << /Type /Pages /Kids [4 0 R] /Count 1\n"
+              + ">> endobj 4 0 obj << /Type /Page /Parent 3 0 R\n"
+              + "/MediaBox [0 0 612 144] /Contents 5 0 R /Resources << /ProcSet 6 0 R\n"
+              + "/Font << /F1 7 0 R >> >> >> endobj 5 0 obj\n"
+              + "<< /Length 73 >> stream BT\n"
+              + "/F1 24 Tf\n"
+              + "100 100 Td\n"
+              + "(Small pdf) Tj\n"
+              + "ET endstream endobj 6 0 obj [/PDF /Text] endobj 7 0 obj\n"
+              + "<< /Type /Font /Subtype /Type1 /Name /F1 /BaseFont /Helvetica\n"
+              + "/Encoding /MacRomanEncoding >> endobj xref 0 8\n"
+              + "0000000000 65535 f 0000000009 00000 n 0000000074 00000 n\n"
+              + "0000000120 00000 n 0000000179 00000 n 0000000364 00000 n\n"
+              + "0000000466 00000 n 0000000496 00000 n\n"
+              + "trailer << /Size 8 /Root 1 0 R >> startxref 625\n"
+              + "%%EOF")
+          .getBytes(StandardCharsets.UTF_8);
 
   private ContentTypeValidator validator;
 
   @Before
   public void setUp() {
-    validator = new ContentTypeValidator(
-        null, new ContentTypeUtil(PATTERN_CACHE), null, null, null);
+    validator =
+        new ContentTypeValidator(null, new ContentTypeUtil(PATTERN_CACHE), null, null, null);
   }
 
   @Test
   public void testBlocked() throws Exception {
-    String[] patterns =
-        new String[] {"application/pdf", "application/xml", "text/html"};
+    String[] patterns = new String[] {"application/pdf", "application/xml", "text/html"};
 
     try (RevWalk rw = new RevWalk(repo)) {
-      List<CommitValidationMessage> m = validator.performValidation(
-          repo, makeCommit(rw), rw, patterns, false);
-      assertThat(TestUtils.transformMessages(m)).containsExactly(
-          "ERROR: found blocked content type (application/pdf) in file: foo.pdf",
-          "ERROR: found blocked content type (application/xml) in file: foo.xml",
-          "ERROR: found blocked content type (text/html) in file: foo.html");
+      List<CommitValidationMessage> m =
+          validator.performValidation(repo, makeCommit(rw), rw, patterns, false);
+      assertThat(TestUtils.transformMessages(m))
+          .containsExactly(
+              "ERROR: found blocked content type (application/pdf) in file: foo.pdf",
+              "ERROR: found blocked content type (application/xml) in file: foo.xml",
+              "ERROR: found blocked content type (text/html) in file: foo.html");
     }
   }
 
@@ -81,10 +85,10 @@
     String[] patterns = new String[] {"application/pdf", "application/xml"};
 
     try (RevWalk rw = new RevWalk(repo)) {
-      List<CommitValidationMessage> m = validator.performValidation(
-          repo, makeCommit(rw), rw, patterns, true);
-      assertThat(TestUtils.transformMessages(m)).containsExactly(
-          "ERROR: found blocked content type (text/html) in file: foo.html");
+      List<CommitValidationMessage> m =
+          validator.performValidation(repo, makeCommit(rw), rw, patterns, true);
+      assertThat(TestUtils.transformMessages(m))
+          .containsExactly("ERROR: found blocked content type (text/html) in file: foo.html");
     }
   }
 
@@ -98,12 +102,11 @@
     Map<File, byte[]> files = new HashMap<>();
 
     String content = "<?xml version=\"1.0\"?><a><b>c</b></a>";
-    files.put(TestUtils.createEmptyFile("foo.xml", repo),
-        content.getBytes(StandardCharsets.UTF_8));
+    files.put(TestUtils.createEmptyFile("foo.xml", repo), content.getBytes(StandardCharsets.UTF_8));
 
     content = "<html><body><h1>Hello World!</h1></body></html>";
-    files.put(TestUtils.createEmptyFile("foo.html", repo),
-        content.getBytes(StandardCharsets.UTF_8));
+    files.put(
+        TestUtils.createEmptyFile("foo.html", repo), content.getBytes(StandardCharsets.UTF_8));
 
     files.put(TestUtils.createEmptyFile("foo.pdf", repo), TEST_PDF);
     return TestUtils.makeCommit(rw, repo, "Commit with test files.", files);
diff --git a/src/test/java/com/googlesource/gerrit/plugins/uploadvalidator/DuplicatePathnameValidatorTest.java b/src/test/java/com/googlesource/gerrit/plugins/uploadvalidator/DuplicatePathnameValidatorTest.java
index cc0cee3..8954d35 100644
--- a/src/test/java/com/googlesource/gerrit/plugins/uploadvalidator/DuplicatePathnameValidatorTest.java
+++ b/src/test/java/com/googlesource/gerrit/plugins/uploadvalidator/DuplicatePathnameValidatorTest.java
@@ -45,10 +45,7 @@
 
 public class DuplicatePathnameValidatorTest extends ValidatorTestCase {
   private static final ImmutableList<String> INITIAL_PATHNAMES =
-      ImmutableList.of(
-          "a" , "ab",
-          "f1/a", "f1/ab",
-          "f2/a", "f2/ab", "f2/sF1/a", "f2/sF1/ab");
+      ImmutableList.of("a", "ab", "f1/a", "f1/ab", "f2/a", "f2/ab", "f2/sF1/a", "f2/sF1/ab");
 
   private final List<String> vistedPaths = Lists.newArrayList();
   private final List<CommitValidationMessage> messages = Lists.newArrayList();
@@ -57,11 +54,17 @@
   private Set<String> changedPaths;
   private DuplicatePathnameValidator validator;
 
-  private void runCheck(List<String> existingTreePaths, Set<String> testPaths,
-    List<CommitValidationMessage> messages, List<String> visitedPaths)
-        throws Exception {
-    RevCommit c = makeCommit(
-        testRepo.getRevWalk(), createEmptyDirCacheEntries(existingTreePaths, testRepo), testRepo);
+  private void runCheck(
+      List<String> existingTreePaths,
+      Set<String> testPaths,
+      List<CommitValidationMessage> messages,
+      List<String> visitedPaths)
+      throws Exception {
+    RevCommit c =
+        makeCommit(
+            testRepo.getRevWalk(),
+            createEmptyDirCacheEntries(existingTreePaths, testRepo),
+            testRepo);
     try (TreeWalk tw = new TreeWalk(repo)) {
       tw.setRecursive(false);
       tw.addTree(c.getTree());
@@ -85,16 +88,14 @@
     runCheck(INITIAL_PATHNAMES, changedPaths, messages, vistedPaths);
     assertThat(transformMessages(messages))
         .containsExactly(transformMessage(conflict("f1/A", "f1/a")));
-    assertThat(vistedPaths).containsExactly(
-        "a", "ab", "f1", "f1/a", "f1/ab", "f2");
+    assertThat(vistedPaths).containsExactly("a", "ab", "f1", "f1/a", "f1/ab", "f2");
   }
 
   @Test
   public void testFindConflictingSubtree() throws Exception {
     changedPaths = Sets.newHashSet("F1/a");
     runCheck(INITIAL_PATHNAMES, changedPaths, messages, vistedPaths);
-    assertThat(transformMessages(messages))
-        .containsExactly(transformMessage(conflict("F1", "f1")));
+    assertThat(transformMessages(messages)).containsExactly(transformMessage(conflict("F1", "f1")));
     assertThat(vistedPaths).containsExactly("a", "ab", "f1", "f2");
   }
 
@@ -102,23 +103,23 @@
   public void testFindConflictingSubtree2() throws Exception {
     changedPaths = Sets.newHashSet("f2/sf1", "F1/a");
     runCheck(INITIAL_PATHNAMES, changedPaths, messages, vistedPaths);
-    assertThat(transformMessages(messages)).containsExactly(
-        transformMessage(conflict("F1", "f1")),
-        transformMessage(conflict("f2/sf1", "f2/sF1")));
-    assertThat(vistedPaths).containsExactly(
-        "a", "ab", "f1", "f2", "f2/a", "f2/ab", "f2/sF1");
+    assertThat(transformMessages(messages))
+        .containsExactly(
+            transformMessage(conflict("F1", "f1")), transformMessage(conflict("f2/sf1", "f2/sF1")));
+    assertThat(vistedPaths).containsExactly("a", "ab", "f1", "f2", "f2/a", "f2/ab", "f2/sF1");
   }
 
   @Test
   public void testFindDuplicates() throws Exception {
     changedPaths = Sets.newHashSet("AB", "f1/A", "f2/Ab");
     runCheck(INITIAL_PATHNAMES, changedPaths, messages, vistedPaths);
-    assertThat(transformMessages(messages)).containsExactly(
-        transformMessage(conflict("AB", "ab")),
-        transformMessage(conflict("f1/A", "f1/a")),
-        transformMessage(conflict("f2/Ab", "f2/ab")));
-    assertThat(vistedPaths).containsExactly(
-        "a", "ab", "f1", "f1/a", "f1/ab", "f2", "f2/a", "f2/ab", "f2/sF1");
+    assertThat(transformMessages(messages))
+        .containsExactly(
+            transformMessage(conflict("AB", "ab")),
+            transformMessage(conflict("f1/A", "f1/a")),
+            transformMessage(conflict("f2/Ab", "f2/ab")));
+    assertThat(vistedPaths)
+        .containsExactly("a", "ab", "f1", "f1/a", "f1/ab", "f2", "f2/a", "f2/ab", "f2/sF1");
   }
 
   @Test
@@ -126,8 +127,7 @@
     changedPaths = Sets.newHashSet("a", "ab", "f1/ab");
     runCheck(INITIAL_PATHNAMES, changedPaths, messages, vistedPaths);
     assertThat(messages).isEmpty();
-    assertThat(vistedPaths).containsExactly(
-        "a", "ab", "f1", "f1/a", "f1/ab", "f2");
+    assertThat(vistedPaths).containsExactly("a", "ab", "f1", "f1/a", "f1/ab", "f2");
   }
 
   @Test
@@ -138,42 +138,41 @@
     filenames.add("F1/ab");
     filenames.add("f2/sF1/aB");
     try (RevWalk rw = new RevWalk(repo)) {
-      RevCommit c =
-          makeCommit(rw, createEmptyDirCacheEntries(filenames, testRepo), testRepo);
+      RevCommit c = makeCommit(rw, createEmptyDirCacheEntries(filenames, testRepo), testRepo);
       List<CommitValidationMessage> m = validator.performValidation(repo, c, rw);
       assertThat(m).hasSize(4);
       // During checking inside of the commit it's unknown which file is checked
       // first, because of that, both capabilities must be checked.
-      assertThat(transformMessages(m)).containsAnyOf(
-          transformMessage(conflict("A", "a")),
-          transformMessage(conflict("a", "A")));
+      assertThat(transformMessages(m))
+          .containsAnyOf(
+              transformMessage(conflict("A", "a")), transformMessage(conflict("a", "A")));
 
-      assertThat(transformMessages(m)).containsAnyOf(
-          transformMessage(conflict("F1", "f1")),
-          transformMessage(conflict("f1", "F1")));
+      assertThat(transformMessages(m))
+          .containsAnyOf(
+              transformMessage(conflict("F1", "f1")), transformMessage(conflict("f1", "F1")));
 
-      assertThat(transformMessages(m)).containsAnyOf(
-          transformMessage(conflict("F1/ab", "f1/ab")),
-          transformMessage(conflict("f1/ab", "F1/ab")));
+      assertThat(transformMessages(m))
+          .containsAnyOf(
+              transformMessage(conflict("F1/ab", "f1/ab")),
+              transformMessage(conflict("f1/ab", "F1/ab")));
 
-      assertThat(transformMessages(m)).containsAnyOf(
-          transformMessage(
-              conflict("f2/sF1/aB", "f2/sF1/ab")),
-          transformMessage(
-              conflict("f2/sF1/ab", "f2/sF1/aB")));
+      assertThat(transformMessages(m))
+          .containsAnyOf(
+              transformMessage(conflict("f2/sF1/aB", "f2/sF1/ab")),
+              transformMessage(conflict("f2/sF1/ab", "f2/sF1/aB")));
     }
   }
 
   @Test
   public void testCheckRenaming() throws Exception {
     try (RevWalk rw = new RevWalk(repo)) {
-      RevCommit c = makeCommit(
-          rw, createEmptyDirCacheEntries(INITIAL_PATHNAMES, testRepo), testRepo);
+      RevCommit c =
+          makeCommit(rw, createEmptyDirCacheEntries(INITIAL_PATHNAMES, testRepo), testRepo);
       DirCacheEntry[] entries = new DirCacheEntry[INITIAL_PATHNAMES.size()];
       for (int x = 0; x < INITIAL_PATHNAMES.size(); x++) {
         // Rename files
-        entries[x] = createDirCacheEntry(INITIAL_PATHNAMES.get(x).toUpperCase(),
-            EMPTY_CONTENT, testRepo);
+        entries[x] =
+            createDirCacheEntry(INITIAL_PATHNAMES.get(x).toUpperCase(), EMPTY_CONTENT, testRepo);
       }
       RevCommit c1 = makeCommit(rw, entries, testRepo, c);
       List<CommitValidationMessage> m = validator.performValidation(repo, c1, rw);
@@ -183,20 +182,17 @@
 
   @Test
   public void validatorInactiveWhenConfigEmpty() {
-    assertThat(DuplicatePathnameValidator.isActive(EMPTY_PLUGIN_CONFIG))
-        .isFalse();
+    assertThat(DuplicatePathnameValidator.isActive(EMPTY_PLUGIN_CONFIG)).isFalse();
   }
 
   @Test
   public void defaultLocale() {
-    assertThat(DuplicatePathnameValidator.getLocale(EMPTY_PLUGIN_CONFIG))
-        .isEqualTo(Locale.ENGLISH);
+    assertThat(DuplicatePathnameValidator.getLocale(EMPTY_PLUGIN_CONFIG)).isEqualTo(Locale.ENGLISH);
   }
 
   @Test
   public void testGetParentFolder() {
     assertThat(validator.allParentFolders(INITIAL_PATHNAMES))
-        .containsExactlyElementsIn(
-            ImmutableList.of("f1", "f2", "f2/sF1"));
+        .containsExactlyElementsIn(ImmutableList.of("f1", "f2", "f2/sF1"));
   }
 }
diff --git a/src/test/java/com/googlesource/gerrit/plugins/uploadvalidator/EmailAwareValidatorConfigTest.java b/src/test/java/com/googlesource/gerrit/plugins/uploadvalidator/EmailAwareValidatorConfigTest.java
index 46bf3c7..bdf3c0f 100644
--- a/src/test/java/com/googlesource/gerrit/plugins/uploadvalidator/EmailAwareValidatorConfigTest.java
+++ b/src/test/java/com/googlesource/gerrit/plugins/uploadvalidator/EmailAwareValidatorConfigTest.java
@@ -29,52 +29,59 @@
   @Test
   public void isEnabledForAllEmailsByDefault() throws Exception {
     ValidatorConfig config =
-        getConfig("[plugin \"uploadvalidator\"]\n"
-            + "blockedFileExtension = jar");
+        getConfig("[plugin \"uploadvalidator\"]\n" + "blockedFileExtension = jar");
 
-    assertThat(
-        config.isEnabledForRef(anyUser, projectName, "anyRef",
-            "blockedFileExtension")).isTrue();
+    assertThat(config.isEnabledForRef(anyUser, projectName, "anyRef", "blockedFileExtension"))
+        .isTrue();
   }
 
   @Test
   public void isEnabledForSingleEmail() throws Exception {
     ValidatorConfig config =
-        getConfig("[plugin \"uploadvalidator\"]\n"
-            + "   email = " + FakeUserProvider.FAKE_EMAIL + "\n"
-            + "   blockedFileExtension = jar");
+        getConfig(
+            "[plugin \"uploadvalidator\"]\n"
+                + "   email = "
+                + FakeUserProvider.FAKE_EMAIL
+                + "\n"
+                + "   blockedFileExtension = jar");
 
     assertThat(
-        config.isEnabledForRef(anyUser, projectName, "refs/heads/anyref",
-            "blockedFileExtension")).isTrue();
+            config.isEnabledForRef(
+                anyUser, projectName, "refs/heads/anyref", "blockedFileExtension"))
+        .isTrue();
   }
 
   @Test
   public void isDisabledForInvalidEmail() throws Exception {
     ValidatorConfig config =
-        getConfig("[plugin \"uploadvalidator\"]\n"
-            + "   email = anInvalidEmail@example.com\n"
-            + "   blockedFileExtension = jar");
+        getConfig(
+            "[plugin \"uploadvalidator\"]\n"
+                + "   email = anInvalidEmail@example.com\n"
+                + "   blockedFileExtension = jar");
 
     assertThat(
-        config.isEnabledForRef(anyUser, projectName, "refs/heads/anyref",
-            "blockedFileExtension")).isFalse();
+            config.isEnabledForRef(
+                anyUser, projectName, "refs/heads/anyref", "blockedFileExtension"))
+        .isFalse();
   }
 
   @Test
   public void isEnabledForRegexEmail() throws Exception {
     IdentifiedUser exampleOrgUser = new FakeUserProvider().get("a@example.org");
     ValidatorConfig config =
-        getConfig("[plugin \"uploadvalidator\"]\n"
-            + "   email = .*@example.org$\n"
-            + "   blockedFileExtension = jar");
+        getConfig(
+            "[plugin \"uploadvalidator\"]\n"
+                + "   email = .*@example.org$\n"
+                + "   blockedFileExtension = jar");
 
     assertThat(
-        config.isEnabledForRef(anyUser, projectName, "refs/heads/anyref",
-            "blockedFileExtension")).isFalse();
+            config.isEnabledForRef(
+                anyUser, projectName, "refs/heads/anyref", "blockedFileExtension"))
+        .isFalse();
     assertThat(
-        config.isEnabledForRef(exampleOrgUser, projectName,
-            "refs/heads/anyref", "blockedFileExtension")).isTrue();
+            config.isEnabledForRef(
+                exampleOrgUser, projectName, "refs/heads/anyref", "blockedFileExtension"))
+        .isTrue();
   }
 
   @Test
@@ -82,27 +89,29 @@
     IdentifiedUser exampleOrgUser = new FakeUserProvider().get("a@example.org");
     IdentifiedUser xUser = new FakeUserProvider().get("x@example.com");
     ValidatorConfig config =
-        getConfig("[plugin \"uploadvalidator\"]\n"
-            + "   email = .*@example.org$\n"
-            + "   email = x@example.com\n"
-            + "   blockedFileExtension = jar");
+        getConfig(
+            "[plugin \"uploadvalidator\"]\n"
+                + "   email = .*@example.org$\n"
+                + "   email = x@example.com\n"
+                + "   blockedFileExtension = jar");
 
     assertThat(
-        config.isEnabledForRef(exampleOrgUser, projectName, "refs/heads/anyref",
-            "blockedFileExtension")).isTrue();
+            config.isEnabledForRef(
+                exampleOrgUser, projectName, "refs/heads/anyref", "blockedFileExtension"))
+        .isTrue();
     assertThat(
-        config.isEnabledForRef(xUser, projectName, "refs/heads/anyref",
-            "blockedFileExtension")).isTrue();
+            config.isEnabledForRef(xUser, projectName, "refs/heads/anyref", "blockedFileExtension"))
+        .isTrue();
     assertThat(
-        config.isEnabledForRef(anyUser, projectName, "refs/heads/anyref",
-            "blockedFileExtension")).isFalse();
+            config.isEnabledForRef(
+                anyUser, projectName, "refs/heads/anyref", "blockedFileExtension"))
+        .isFalse();
   }
 
-  private ValidatorConfig getConfig(String defaultConfig)
-      throws ConfigInvalidException {
+  private ValidatorConfig getConfig(String defaultConfig) throws ConfigInvalidException {
     ValidatorConfig config =
-        new ValidatorConfig(new FakeConfigFactory(projectName, defaultConfig),
-            new FakeGroupCacheUUIDByName());
+        new ValidatorConfig(
+            new FakeConfigFactory(projectName, defaultConfig), new FakeGroupCacheUUIDByName());
     return config;
   }
 }
diff --git a/src/test/java/com/googlesource/gerrit/plugins/uploadvalidator/FakeGroupCacheUUIDByName.java b/src/test/java/com/googlesource/gerrit/plugins/uploadvalidator/FakeGroupCacheUUIDByName.java
index 8cefe93..e800325 100644
--- a/src/test/java/com/googlesource/gerrit/plugins/uploadvalidator/FakeGroupCacheUUIDByName.java
+++ b/src/test/java/com/googlesource/gerrit/plugins/uploadvalidator/FakeGroupCacheUUIDByName.java
@@ -41,8 +41,7 @@
 
   @Override
   public AccountGroup get(NameKey name) {
-    return accountGroup != null && accountGroup.getNameKey().equals(name)
-        ? accountGroup : null;
+    return accountGroup != null && accountGroup.getNameKey().equals(name) ? accountGroup : null;
   }
 
   @Override
@@ -56,15 +55,11 @@
   }
 
   @Override
-  public void onCreateGroup(NameKey newGroupName) throws IOException {
-  }
+  public void onCreateGroup(NameKey newGroupName) throws IOException {}
 
   @Override
-  public void evict(AccountGroup group) throws IOException {
-  }
+  public void evict(AccountGroup group) throws IOException {}
 
   @Override
-  public void evictAfterRename(NameKey oldName, NameKey newName)
-      throws IOException {
-  }
+  public void evictAfterRename(NameKey oldName, NameKey newName) throws IOException {}
 }
diff --git a/src/test/java/com/googlesource/gerrit/plugins/uploadvalidator/FakeGroupMembership.java b/src/test/java/com/googlesource/gerrit/plugins/uploadvalidator/FakeGroupMembership.java
index 102c6a4..43f8bb5 100644
--- a/src/test/java/com/googlesource/gerrit/plugins/uploadvalidator/FakeGroupMembership.java
+++ b/src/test/java/com/googlesource/gerrit/plugins/uploadvalidator/FakeGroupMembership.java
@@ -43,12 +43,12 @@
   @Override
   public Set<UUID> intersection(Iterable<UUID> groupIds) {
     return StreamSupport.stream(groupIds.spliterator(), false)
-        .filter(this::contains).collect(Collectors.toSet());
+        .filter(this::contains)
+        .collect(Collectors.toSet());
   }
 
   @Override
   public Set<UUID> getKnownGroups() {
     return new HashSet<>();
   }
-
 }
diff --git a/src/test/java/com/googlesource/gerrit/plugins/uploadvalidator/FakeUserProvider.java b/src/test/java/com/googlesource/gerrit/plugins/uploadvalidator/FakeUserProvider.java
index 8b36ee7..bf488e1 100644
--- a/src/test/java/com/googlesource/gerrit/plugins/uploadvalidator/FakeUserProvider.java
+++ b/src/test/java/com/googlesource/gerrit/plugins/uploadvalidator/FakeUserProvider.java
@@ -48,8 +48,7 @@
     expect(user.isIdentifiedUser()).andReturn(true);
     expect(user.asIdentifiedUser()).andReturn(user);
     expect(user.getAccount()).andStubReturn(account);
-    expect(user.getEffectiveGroups()).andReturn(
-        new FakeGroupMembership(groupUUID));
+    expect(user.getEffectiveGroups()).andReturn(new FakeGroupMembership(groupUUID));
     replay(user);
     return user;
   }
diff --git a/src/test/java/com/googlesource/gerrit/plugins/uploadvalidator/FileExtensionValidatorTest.java b/src/test/java/com/googlesource/gerrit/plugins/uploadvalidator/FileExtensionValidatorTest.java
index 5ee046c..84dbbca 100644
--- a/src/test/java/com/googlesource/gerrit/plugins/uploadvalidator/FileExtensionValidatorTest.java
+++ b/src/test/java/com/googlesource/gerrit/plugins/uploadvalidator/FileExtensionValidatorTest.java
@@ -57,14 +57,13 @@
   public void testBlockedExtensions() throws Exception {
     try (RevWalk rw = new RevWalk(repo)) {
       RevCommit c = makeCommit(rw, BLOCKED_EXTENSIONS_LC);
-      List<CommitValidationMessage> m = FileExtensionValidator
-          .performValidation(repo, c, rw, BLOCKED_EXTENSIONS_LC);
+      List<CommitValidationMessage> m =
+          FileExtensionValidator.performValidation(repo, c, rw, BLOCKED_EXTENSIONS_LC);
       List<String> expected = new ArrayList<>();
       for (String extension : BLOCKED_EXTENSIONS_LC) {
         expected.add("ERROR: blocked file: foo." + extension);
       }
-      assertThat(TestUtils.transformMessages(m))
-          .containsExactlyElementsIn(expected);
+      assertThat(TestUtils.transformMessages(m)).containsExactlyElementsIn(expected);
     }
   }
 
@@ -72,14 +71,13 @@
   public void testBlockedExtensionsCaseInsensitive() throws Exception {
     try (RevWalk rw = new RevWalk(repo)) {
       RevCommit c = makeCommit(rw, BLOCKED_EXTENSIONS_UC);
-      List<CommitValidationMessage> m = FileExtensionValidator
-          .performValidation(repo, c, rw, BLOCKED_EXTENSIONS_LC);
+      List<CommitValidationMessage> m =
+          FileExtensionValidator.performValidation(repo, c, rw, BLOCKED_EXTENSIONS_LC);
       List<String> expected = new ArrayList<>();
       for (String extension : BLOCKED_EXTENSIONS_UC) {
         expected.add("ERROR: blocked file: foo." + extension);
       }
-      assertThat(TestUtils.transformMessages(m))
-          .containsExactlyElementsIn(expected);
+      assertThat(TestUtils.transformMessages(m)).containsExactlyElementsIn(expected);
     }
   }
 
diff --git a/src/test/java/com/googlesource/gerrit/plugins/uploadvalidator/InvalidFilenameValidatorTest.java b/src/test/java/com/googlesource/gerrit/plugins/uploadvalidator/InvalidFilenameValidatorTest.java
index 6b5191a..dfb81bc 100644
--- a/src/test/java/com/googlesource/gerrit/plugins/uploadvalidator/InvalidFilenameValidatorTest.java
+++ b/src/test/java/com/googlesource/gerrit/plugins/uploadvalidator/InvalidFilenameValidatorTest.java
@@ -58,14 +58,13 @@
     String[] invalidFilenamePattern = {"\\[|\\]|\\*|#", "[%:@]"};
     try (RevWalk rw = new RevWalk(repo)) {
       RevCommit c = makeCommit(rw);
-      List<CommitValidationMessage> m = InvalidFilenameValidator
-          .performValidation(repo, c, rw, invalidFilenamePattern);
+      List<CommitValidationMessage> m =
+          InvalidFilenameValidator.performValidation(repo, c, rw, invalidFilenamePattern);
       Set<String> expected = new HashSet<>();
       for (String filenames : getInvalidFilenames()) {
         expected.add("ERROR: invalid characters found in filename: " + filenames);
       }
-      assertThat(TestUtils.transformMessages(m))
-          .containsExactlyElementsIn(expected);
+      assertThat(TestUtils.transformMessages(m)).containsExactlyElementsIn(expected);
     }
   }
 
diff --git a/src/test/java/com/googlesource/gerrit/plugins/uploadvalidator/InvalidLineEndingValidatorTest.java b/src/test/java/com/googlesource/gerrit/plugins/uploadvalidator/InvalidLineEndingValidatorTest.java
index 664bcb8..bd1d87c 100644
--- a/src/test/java/com/googlesource/gerrit/plugins/uploadvalidator/InvalidLineEndingValidatorTest.java
+++ b/src/test/java/com/googlesource/gerrit/plugins/uploadvalidator/InvalidLineEndingValidatorTest.java
@@ -36,19 +36,15 @@
   private RevCommit makeCommit(RevWalk rw) throws IOException, GitAPIException {
     Map<File, byte[]> files = new HashMap<>();
     // invalid line endings
-    String content = "Testline1\r\n"
-        + "Testline2\n"
-        + "Testline3\r\n"
-        + "Testline4";
-    files.put(new File(repo.getDirectory().getParent(), "foo.txt"),
+    String content = "Testline1\r\n" + "Testline2\n" + "Testline3\r\n" + "Testline4";
+    files.put(
+        new File(repo.getDirectory().getParent(), "foo.txt"),
         content.getBytes(StandardCharsets.UTF_8));
 
     // valid line endings
-    content = "Testline1\n"
-        + "Testline2\n"
-        + "Testline3\n"
-        + "Testline4";
-    files.put(new File(repo.getDirectory().getParent(), "bar.txt"),
+    content = "Testline1\n" + "Testline2\n" + "Testline3\n" + "Testline4";
+    files.put(
+        new File(repo.getDirectory().getParent(), "bar.txt"),
         content.getBytes(StandardCharsets.UTF_8));
     return TestUtils.makeCommit(rw, repo, "Commit with test files.", files);
   }
@@ -57,12 +53,13 @@
   public void testCarriageReturn() throws Exception {
     try (RevWalk rw = new RevWalk(repo)) {
       RevCommit c = makeCommit(rw);
-      InvalidLineEndingValidator validator = new InvalidLineEndingValidator(null,
-          new ContentTypeUtil(PATTERN_CACHE), null, null, null);
-      List<CommitValidationMessage> m = validator.performValidation(repo, c,
-          rw, EMPTY_PLUGIN_CONFIG);
-      assertThat(TestUtils.transformMessages(m)).containsExactly(
-          "ERROR: found carriage return (CR) character in file: foo.txt");
+      InvalidLineEndingValidator validator =
+          new InvalidLineEndingValidator(
+              null, new ContentTypeUtil(PATTERN_CACHE), null, null, null);
+      List<CommitValidationMessage> m =
+          validator.performValidation(repo, c, rw, EMPTY_PLUGIN_CONFIG);
+      assertThat(TestUtils.transformMessages(m))
+          .containsExactly("ERROR: found carriage return (CR) character in file: foo.txt");
     }
   }
 
diff --git a/src/test/java/com/googlesource/gerrit/plugins/uploadvalidator/MaxPathLengthValidatorTest.java b/src/test/java/com/googlesource/gerrit/plugins/uploadvalidator/MaxPathLengthValidatorTest.java
index 16f73d6..951659a 100644
--- a/src/test/java/com/googlesource/gerrit/plugins/uploadvalidator/MaxPathLengthValidatorTest.java
+++ b/src/test/java/com/googlesource/gerrit/plugins/uploadvalidator/MaxPathLengthValidatorTest.java
@@ -52,12 +52,9 @@
     try (RevWalk rw = new RevWalk(repo)) {
       RevCommit c = makeCommit(rw);
       List<CommitValidationMessage> m =
-          MaxPathLengthValidator.performValidation(repo, c, rw,
-              getMaxPathLength());
-      Set<String> expected =
-          ImmutableSet.of("ERROR: path too long: " + TOO_LONG);
-      assertThat(TestUtils.transformMessages(m))
-          .containsExactlyElementsIn(expected);
+          MaxPathLengthValidator.performValidation(repo, c, rw, getMaxPathLength());
+      Set<String> expected = ImmutableSet.of("ERROR: path too long: " + TOO_LONG);
+      assertThat(TestUtils.transformMessages(m)).containsExactlyElementsIn(expected);
     }
   }
 
@@ -65,15 +62,15 @@
   public void testDeleteTooLongPath() throws Exception {
     try (RevWalk rw = new RevWalk(repo)) {
       RevCommit c = makeCommit(rw);
-      try(Git git = new Git(repo)) {
+      try (Git git = new Git(repo)) {
         Set<File> files = new HashSet<>();
         files.add(TestUtils.createEmptyFile(TOO_LONG, repo));
         TestUtils.removeFiles(git, files);
         c = git.commit().setMessage("Delete file which is too long").call();
         rw.parseCommit(c);
       }
-      List<CommitValidationMessage> m = MaxPathLengthValidator
-          .performValidation(repo, c, rw, getMaxPathLength());
+      List<CommitValidationMessage> m =
+          MaxPathLengthValidator.performValidation(repo, c, rw, getMaxPathLength());
       assertThat(m).isEmpty();
     }
   }
diff --git a/src/test/java/com/googlesource/gerrit/plugins/uploadvalidator/ProjectAwareValidatorConfigTest.java b/src/test/java/com/googlesource/gerrit/plugins/uploadvalidator/ProjectAwareValidatorConfigTest.java
index 1ddcdc3..601fcf6 100644
--- a/src/test/java/com/googlesource/gerrit/plugins/uploadvalidator/ProjectAwareValidatorConfigTest.java
+++ b/src/test/java/com/googlesource/gerrit/plugins/uploadvalidator/ProjectAwareValidatorConfigTest.java
@@ -29,58 +29,58 @@
   @Test
   public void isEnabledForAllProjectsByDefault() throws Exception {
     ValidatorConfig config =
-        getConfig("[plugin \"uploadvalidator\"]\n"
-            + "blockedFileExtension = jar", projectName);
+        getConfig("[plugin \"uploadvalidator\"]\n" + "blockedFileExtension = jar", projectName);
 
-    assertThat(
-        config.isEnabledForRef(anyUser, projectName, "anyRef",
-            "blockedFileExtension")).isTrue();
+    assertThat(config.isEnabledForRef(anyUser, projectName, "anyRef", "blockedFileExtension"))
+        .isTrue();
   }
 
   @Test
   public void isEnabledForSingleProject() throws Exception {
     ValidatorConfig config =
-        getConfig("[plugin \"uploadvalidator\"]\n"
-            + "   project = testProject\n"
-            + "   blockedFileExtension = jar", projectName);
+        getConfig(
+            "[plugin \"uploadvalidator\"]\n"
+                + "   project = testProject\n"
+                + "   blockedFileExtension = jar",
+            projectName);
 
-    assertThat(
-        config.isEnabledForRef(anyUser, projectName, "anyRef",
-            "blockedFileExtension")).isTrue();
+    assertThat(config.isEnabledForRef(anyUser, projectName, "anyRef", "blockedFileExtension"))
+        .isTrue();
   }
 
   @Test
   public void isDisabledForInvalidProject() throws Exception {
     ValidatorConfig config =
-        getConfig("[plugin \"uploadvalidator\"]\n"
-            + "   project = someOtherProject\n"
-            + "   blockedFileExtension = jar", projectName);
+        getConfig(
+            "[plugin \"uploadvalidator\"]\n"
+                + "   project = someOtherProject\n"
+                + "   blockedFileExtension = jar",
+            projectName);
 
-    assertThat(
-        config.isEnabledForRef(anyUser, projectName, "anyRef",
-            "blockedFileExtension")).isFalse();
+    assertThat(config.isEnabledForRef(anyUser, projectName, "anyRef", "blockedFileExtension"))
+        .isFalse();
   }
 
   @Test
   public void isEnabledForRegexProject() throws Exception {
-    String configString = "[plugin \"uploadvalidator\"]\n"
-        + "   project = test.*\n"
-        + "   blockedFileExtension = jar";
+    String configString =
+        "[plugin \"uploadvalidator\"]\n"
+            + "   project = test.*\n"
+            + "   blockedFileExtension = jar";
     Project.NameKey otherNameKey = new Project.NameKey("someOtherProject");
     ValidatorConfig config = getConfig(configString, projectName);
     ValidatorConfig config2 = getConfig(configString, otherNameKey);
 
-    assertThat(
-        config.isEnabledForRef(anyUser, projectName, "anyRef",
-            "blockedFileExtension")).isTrue();
-    assertThat(
-        config2.isEnabledForRef(anyUser, otherNameKey,
-            "anyRef", "blockedFileExtension")).isFalse();
+    assertThat(config.isEnabledForRef(anyUser, projectName, "anyRef", "blockedFileExtension"))
+        .isTrue();
+    assertThat(config2.isEnabledForRef(anyUser, otherNameKey, "anyRef", "blockedFileExtension"))
+        .isFalse();
   }
 
   @Test
   public void isEnabledForMultipleProjects() throws Exception {
-    String configString = "[plugin \"uploadvalidator\"]\n"
+    String configString =
+        "[plugin \"uploadvalidator\"]\n"
             + "   project = testProject\n"
             + "   project = another.*\n"
             + "   blockedFileExtension = jar";
@@ -90,23 +90,19 @@
     ValidatorConfig config2 = getConfig(configString, anotherNameKey);
     ValidatorConfig config3 = getConfig(configString, someOtherNameKey);
 
-    assertThat(
-        config.isEnabledForRef(anyUser, projectName, "anyRef",
-            "blockedFileExtension")).isTrue();
-    assertThat(
-        config2.isEnabledForRef(anyUser, anotherNameKey, "anyRef",
-            "blockedFileExtension")).isTrue();
-    assertThat(
-        config3.isEnabledForRef(anyUser, someOtherNameKey, "anyRef",
-            "blockedFileExtension")).isFalse();
+    assertThat(config.isEnabledForRef(anyUser, projectName, "anyRef", "blockedFileExtension"))
+        .isTrue();
+    assertThat(config2.isEnabledForRef(anyUser, anotherNameKey, "anyRef", "blockedFileExtension"))
+        .isTrue();
+    assertThat(config3.isEnabledForRef(anyUser, someOtherNameKey, "anyRef", "blockedFileExtension"))
+        .isFalse();
   }
 
-  private ValidatorConfig getConfig(
-      String defaultConfig, Project.NameKey projName)
+  private ValidatorConfig getConfig(String defaultConfig, Project.NameKey projName)
       throws ConfigInvalidException {
     ValidatorConfig config =
-        new ValidatorConfig(new FakeConfigFactory(projName, defaultConfig),
-            new FakeGroupCacheUUIDByName());
+        new ValidatorConfig(
+            new FakeConfigFactory(projName, defaultConfig), new FakeGroupCacheUUIDByName());
     return config;
   }
 }
diff --git a/src/test/java/com/googlesource/gerrit/plugins/uploadvalidator/RefAwareValidatorConfigTest.java b/src/test/java/com/googlesource/gerrit/plugins/uploadvalidator/RefAwareValidatorConfigTest.java
index 111b16b..ac4094f 100644
--- a/src/test/java/com/googlesource/gerrit/plugins/uploadvalidator/RefAwareValidatorConfigTest.java
+++ b/src/test/java/com/googlesource/gerrit/plugins/uploadvalidator/RefAwareValidatorConfigTest.java
@@ -23,84 +23,91 @@
 import org.junit.Test;
 
 public class RefAwareValidatorConfigTest {
-  private final Project.NameKey projectName =
-      new Project.NameKey("testProject");
+  private final Project.NameKey projectName = new Project.NameKey("testProject");
   private final IdentifiedUser anyUser = new FakeUserProvider().get();
 
   @Test
   public void isEnabledForAllRefsByDefault() throws Exception {
     ValidatorConfig config =
-        getConfig("[plugin \"uploadvalidator\"]\n"
-            + "blockedFileExtension = jar");
+        getConfig("[plugin \"uploadvalidator\"]\n" + "blockedFileExtension = jar");
 
-    assertThat(
-        config.isEnabledForRef(anyUser, projectName, "anyRef",
-            "blockedFileExtension")).isTrue();
+    assertThat(config.isEnabledForRef(anyUser, projectName, "anyRef", "blockedFileExtension"))
+        .isTrue();
   }
 
   @Test
   public void isEnabledForSingleRef() throws Exception {
     ValidatorConfig config =
-        getConfig("[plugin \"uploadvalidator\"]\n"
-            + "   ref = refs/heads/anyref\n"
-            + "   blockedFileExtension = jar");
+        getConfig(
+            "[plugin \"uploadvalidator\"]\n"
+                + "   ref = refs/heads/anyref\n"
+                + "   blockedFileExtension = jar");
 
     assertThat(
-        config.isEnabledForRef(anyUser, projectName, "refs/heads/anyref",
-            "blockedFileExtension")).isTrue();
+            config.isEnabledForRef(
+                anyUser, projectName, "refs/heads/anyref", "blockedFileExtension"))
+        .isTrue();
   }
 
   @Test
   public void isDisabledForInvalidRef() throws Exception {
     ValidatorConfig config =
-        getConfig("[plugin \"uploadvalidator\"]\n"
-            + "   ref = anInvalidRef\n"
-            + "   blockedFileExtension = jar");
+        getConfig(
+            "[plugin \"uploadvalidator\"]\n"
+                + "   ref = anInvalidRef\n"
+                + "   blockedFileExtension = jar");
 
     assertThat(
-        config.isEnabledForRef(anyUser, projectName, "refs/heads/anyref",
-            "blockedFileExtension")).isFalse();
+            config.isEnabledForRef(
+                anyUser, projectName, "refs/heads/anyref", "blockedFileExtension"))
+        .isFalse();
   }
 
   @Test
   public void isEnabledForRegexRef() throws Exception {
     ValidatorConfig config =
-        getConfig("[plugin \"uploadvalidator\"]\n"
-            + "   ref = ^refs/heads/mybranch.*\n"
-            + "   blockedFileExtension = jar");
+        getConfig(
+            "[plugin \"uploadvalidator\"]\n"
+                + "   ref = ^refs/heads/mybranch.*\n"
+                + "   blockedFileExtension = jar");
 
     assertThat(
-        config.isEnabledForRef(anyUser, projectName, "refs/heads/anotherref",
-            "blockedFileExtension")).isFalse();
+            config.isEnabledForRef(
+                anyUser, projectName, "refs/heads/anotherref", "blockedFileExtension"))
+        .isFalse();
     assertThat(
-        config.isEnabledForRef(anyUser, projectName, "refs/heads/mybranch123",
-            "blockedFileExtension")).isTrue();
+            config.isEnabledForRef(
+                anyUser, projectName, "refs/heads/mybranch123", "blockedFileExtension"))
+        .isTrue();
   }
 
   @Test
   public void isEnabledForMultipleRefs() throws Exception {
     ValidatorConfig config =
-        getConfig("[plugin \"uploadvalidator\"]\n"
-            + "   ref = refs/heads/branch1\n"
-            + "   ref = refs/heads/branch2\n"
-            + "   blockedFileExtension = jar");
+        getConfig(
+            "[plugin \"uploadvalidator\"]\n"
+                + "   ref = refs/heads/branch1\n"
+                + "   ref = refs/heads/branch2\n"
+                + "   blockedFileExtension = jar");
 
     assertThat(
-        config.isEnabledForRef(anyUser, projectName, "refs/heads/branch1",
-            "blockedFileExtension")).isTrue();
+            config.isEnabledForRef(
+                anyUser, projectName, "refs/heads/branch1", "blockedFileExtension"))
+        .isTrue();
     assertThat(
-        config.isEnabledForRef(anyUser, projectName, "refs/heads/branch2",
-            "blockedFileExtension")).isTrue();
+            config.isEnabledForRef(
+                anyUser, projectName, "refs/heads/branch2", "blockedFileExtension"))
+        .isTrue();
     assertThat(
-        config.isEnabledForRef(anyUser, projectName, "refs/heads/branch3",
-            "blockedFileExtension")).isFalse();
+            config.isEnabledForRef(
+                anyUser, projectName, "refs/heads/branch3", "blockedFileExtension"))
+        .isFalse();
   }
 
-  private ValidatorConfig getConfig(String defaultConfig)
-      throws ConfigInvalidException {
+  private ValidatorConfig getConfig(String defaultConfig) throws ConfigInvalidException {
     ValidatorConfig config =
-        new ValidatorConfig(new FakeConfigFactory(projectName, defaultConfig),
-            new FakeGroupCacheUUIDByName());
+        new ValidatorConfig(
+            new FakeConfigFactory(projectName, defaultConfig), new FakeGroupCacheUUIDByName());
     return config;
   }
 }
diff --git a/src/test/java/com/googlesource/gerrit/plugins/uploadvalidator/SkipValidationTest.java b/src/test/java/com/googlesource/gerrit/plugins/uploadvalidator/SkipValidationTest.java
index bfbd069..367acad 100644
--- a/src/test/java/com/googlesource/gerrit/plugins/uploadvalidator/SkipValidationTest.java
+++ b/src/test/java/com/googlesource/gerrit/plugins/uploadvalidator/SkipValidationTest.java
@@ -23,19 +23,15 @@
 import org.junit.Test;
 
 public class SkipValidationTest {
-  private final Project.NameKey projectName =
-      new Project.NameKey("testProject");
+  private final Project.NameKey projectName = new Project.NameKey("testProject");
   private final IdentifiedUser anyUser = new FakeUserProvider().get();
 
   @Test
   public void dontSkipByDefault() throws Exception {
     ValidatorConfig validatorConfig =
-        new ValidatorConfig(new FakeConfigFactory(projectName, ""),
-            new FakeGroupCacheUUIDByName());
+        new ValidatorConfig(new FakeConfigFactory(projectName, ""), new FakeGroupCacheUUIDByName());
 
-    assertThat(
-        validatorConfig
-            .isEnabledForRef(anyUser, projectName, "anyRef", "anyOp")).isTrue();
+    assertThat(validatorConfig.isEnabledForRef(anyUser, projectName, "anyRef", "anyOp")).isTrue();
   }
 
   @Test
@@ -47,32 +43,36 @@
             + "skipGroup=anotherGroup";
 
     ValidatorConfig validatorConfig =
-        new ValidatorConfig(new FakeConfigFactory(projectName, config),
-            new FakeGroupCacheUUIDByName());
+        new ValidatorConfig(
+            new FakeConfigFactory(projectName, config), new FakeGroupCacheUUIDByName());
 
     assertThat(
-        validatorConfig.isEnabledForRef(new FakeUserProvider("testGroup",
-            "yetAnotherGroup").get(), projectName, "anyRef", "testOp"))
+            validatorConfig.isEnabledForRef(
+                new FakeUserProvider("testGroup", "yetAnotherGroup").get(),
+                projectName,
+                "anyRef",
+                "testOp"))
         .isFalse();
   }
 
   @Test
   public void skipWhenUserBelongsToGroupName() throws Exception {
     String config =
-        "[plugin \"uploadvalidator\"]\n"
-            + "skipValidation=testOp\n"
-            + "skipGroup=testGroupName\n";
+        "[plugin \"uploadvalidator\"]\n" + "skipValidation=testOp\n" + "skipGroup=testGroupName\n";
 
     ValidatorConfig validatorConfig =
-        new ValidatorConfig(new FakeConfigFactory(projectName, config),
-            new FakeGroupCacheUUIDByName(new AccountGroup(
-                new AccountGroup.NameKey("testGroupName"), new AccountGroup.Id(
-                    1), new AccountGroup.UUID("testGroupId"))));
+        new ValidatorConfig(
+            new FakeConfigFactory(projectName, config),
+            new FakeGroupCacheUUIDByName(
+                new AccountGroup(
+                    new AccountGroup.NameKey("testGroupName"),
+                    new AccountGroup.Id(1),
+                    new AccountGroup.UUID("testGroupId"))));
 
     assertThat(
-        validatorConfig.isEnabledForRef(
-            new FakeUserProvider("testGroupId").get(), projectName, "anyRef",
-            "testOp")).isFalse();
+            validatorConfig.isEnabledForRef(
+                new FakeUserProvider("testGroupId").get(), projectName, "anyRef", "testOp"))
+        .isFalse();
   }
 
   @Test
@@ -84,13 +84,13 @@
             + "skipGroup=anotherGroup";
 
     ValidatorConfig validatorConfig =
-        new ValidatorConfig(new FakeConfigFactory(projectName, config),
-            new FakeGroupCacheUUIDByName());
+        new ValidatorConfig(
+            new FakeConfigFactory(projectName, config), new FakeGroupCacheUUIDByName());
 
     assertThat(
-        validatorConfig.isEnabledForRef(
-            new FakeUserProvider("yetAnotherGroup").get(), projectName,
-            "anyRef", "testOp")).isTrue();
+            validatorConfig.isEnabledForRef(
+                new FakeUserProvider("yetAnotherGroup").get(), projectName, "anyRef", "testOp"))
+        .isTrue();
   }
 
   @Test
@@ -102,12 +102,11 @@
             + "skipGroup=anotherGroup";
 
     ValidatorConfig validatorConfig =
-        new ValidatorConfig(new FakeConfigFactory(projectName, config),
-            new FakeGroupCacheUUIDByName());
+        new ValidatorConfig(
+            new FakeConfigFactory(projectName, config), new FakeGroupCacheUUIDByName());
 
-    assertThat(
-        validatorConfig.isEnabledForRef(anyUser, projectName, "anyRef",
-            "anotherOp")).isTrue();
+    assertThat(validatorConfig.isEnabledForRef(anyUser, projectName, "anyRef", "anotherOp"))
+        .isTrue();
   }
 
   @Test
@@ -119,13 +118,13 @@
             + "skipGroup=testGroup";
 
     ValidatorConfig validatorConfig =
-        new ValidatorConfig(new FakeConfigFactory(projectName, config),
-            new FakeGroupCacheUUIDByName());
+        new ValidatorConfig(
+            new FakeConfigFactory(projectName, config), new FakeGroupCacheUUIDByName());
 
     assertThat(
-        validatorConfig.isEnabledForRef(
-            new FakeUserProvider("testGroup").get(), projectName,
-            "refs/heads/myref", "testOp")).isFalse();
+            validatorConfig.isEnabledForRef(
+                new FakeUserProvider("testGroup").get(), projectName, "refs/heads/myref", "testOp"))
+        .isFalse();
   }
 
   @Test
@@ -137,11 +136,12 @@
             + "skipGroup=testGroup";
 
     ValidatorConfig validatorConfig =
-        new ValidatorConfig(new FakeConfigFactory(projectName, config),
-            new FakeGroupCacheUUIDByName());
+        new ValidatorConfig(
+            new FakeConfigFactory(projectName, config), new FakeGroupCacheUUIDByName());
 
     assertThat(
-        validatorConfig.isEnabledForRef(anyUser, projectName,
-            "refs/heads/anotherRef", "testOp")).isTrue();
+            validatorConfig.isEnabledForRef(
+                anyUser, projectName, "refs/heads/anotherRef", "testOp"))
+        .isTrue();
   }
 }
diff --git a/src/test/java/com/googlesource/gerrit/plugins/uploadvalidator/SubmoduleValidatorTest.java b/src/test/java/com/googlesource/gerrit/plugins/uploadvalidator/SubmoduleValidatorTest.java
index 4f867a7..04d4dda 100644
--- a/src/test/java/com/googlesource/gerrit/plugins/uploadvalidator/SubmoduleValidatorTest.java
+++ b/src/test/java/com/googlesource/gerrit/plugins/uploadvalidator/SubmoduleValidatorTest.java
@@ -33,8 +33,7 @@
 import java.util.Map;
 
 public class SubmoduleValidatorTest extends ValidatorTestCase {
-  private RevCommit makeCommitWithSubmodule(RevWalk rw)
-      throws IOException, GitAPIException {
+  private RevCommit makeCommitWithSubmodule(RevWalk rw) throws IOException, GitAPIException {
     try (Git git = new Git(repo)) {
       SubmoduleAddCommand addCommand = git.submoduleAdd();
       addCommand.setURI(repo.getDirectory().getCanonicalPath());
@@ -49,15 +48,13 @@
   public void testWithSubmodule() throws Exception {
     try (RevWalk rw = new RevWalk(repo)) {
       RevCommit c = makeCommitWithSubmodule(rw);
-      List<CommitValidationMessage> m =
-          SubmoduleValidator.performValidation(repo, c, rw);
+      List<CommitValidationMessage> m = SubmoduleValidator.performValidation(repo, c, rw);
       assertThat(TestUtils.transformMessages(m))
           .containsExactly("ERROR: submodules are not allowed: modules/library");
     }
   }
 
-  private RevCommit makeCommitWithoutSubmodule(RevWalk rw)
-      throws IOException, GitAPIException {
+  private RevCommit makeCommitWithoutSubmodule(RevWalk rw) throws IOException, GitAPIException {
     Map<File, byte[]> files = new HashMap<>();
     files.put(new File(repo.getDirectory().getParent(), "foo.txt"), null);
     return TestUtils.makeCommit(rw, repo, "Commit with empty test files.", files);
@@ -67,8 +64,7 @@
   public void testWithoutSubmodule() throws Exception {
     try (RevWalk rw = new RevWalk(repo)) {
       RevCommit c = makeCommitWithoutSubmodule(rw);
-      List<CommitValidationMessage> m =
-          SubmoduleValidator.performValidation(repo, c, rw);
+      List<CommitValidationMessage> m = SubmoduleValidator.performValidation(repo, c, rw);
       assertThat(m).isEmpty();
     }
   }
diff --git a/src/test/java/com/googlesource/gerrit/plugins/uploadvalidator/SymlinkValidatorTest.java b/src/test/java/com/googlesource/gerrit/plugins/uploadvalidator/SymlinkValidatorTest.java
index 2e17c29..3d1f3c0 100644
--- a/src/test/java/com/googlesource/gerrit/plugins/uploadvalidator/SymlinkValidatorTest.java
+++ b/src/test/java/com/googlesource/gerrit/plugins/uploadvalidator/SymlinkValidatorTest.java
@@ -35,8 +35,7 @@
 import java.util.Set;
 
 public class SymlinkValidatorTest extends ValidatorTestCase {
-  private RevCommit makeCommitWithSymlink(RevWalk rw)
-      throws IOException, GitAPIException {
+  private RevCommit makeCommitWithSymlink(RevWalk rw) throws IOException, GitAPIException {
     Map<File, byte[]> files = new HashMap<>();
     File link = new File(repo.getDirectory().getParent(), "foo.txt");
     Files.createSymbolicLink(link.toPath(), Paths.get("bar.txt"));
@@ -55,16 +54,15 @@
       RevCommit c = makeCommitWithSymlink(rw);
       List<CommitValidationMessage> m =
           SymlinkValidator.performValidation(repo, rw.parseCommit(c), rw);
-      Set<String> expected = ImmutableSet.of(
-          "ERROR: Symbolic links are not allowed: foo.txt",
-          "ERROR: Symbolic links are not allowed: symbolicFolder");
-      assertThat(TestUtils.transformMessages(m))
-          .containsExactlyElementsIn(expected);
+      Set<String> expected =
+          ImmutableSet.of(
+              "ERROR: Symbolic links are not allowed: foo.txt",
+              "ERROR: Symbolic links are not allowed: symbolicFolder");
+      assertThat(TestUtils.transformMessages(m)).containsExactlyElementsIn(expected);
     }
   }
 
-  private RevCommit makeCommitWithoutSymlink(RevWalk rw)
-      throws IOException, GitAPIException {
+  private RevCommit makeCommitWithoutSymlink(RevWalk rw) throws IOException, GitAPIException {
     Map<File, byte[]> files = new HashMap<>();
     files.put(new File(repo.getDirectory().getParent(), "foo.txt"), null);
     return TestUtils.makeCommit(rw, repo, "Commit with empty test files.", files);
diff --git a/src/test/java/com/googlesource/gerrit/plugins/uploadvalidator/TestUtils.java b/src/test/java/com/googlesource/gerrit/plugins/uploadvalidator/TestUtils.java
index 21d4f31..91d9052 100644
--- a/src/test/java/com/googlesource/gerrit/plugins/uploadvalidator/TestUtils.java
+++ b/src/test/java/com/googlesource/gerrit/plugins/uploadvalidator/TestUtils.java
@@ -45,8 +45,7 @@
 import java.util.regex.Pattern;
 
 public class TestUtils {
-  public static final PluginConfig EMPTY_PLUGIN_CONFIG =
-      new PluginConfig("", new Config());
+  public static final PluginConfig EMPTY_PLUGIN_CONFIG = new PluginConfig("", new Config());
 
   protected static final byte[] EMPTY_CONTENT = "".getBytes(Charsets.UTF_8);
 
@@ -60,18 +59,16 @@
       };
 
   public static final LoadingCache<String, Pattern> PATTERN_CACHE =
-    CacheBuilder.newBuilder().build(new PatternCacheModule.Loader());
+      CacheBuilder.newBuilder().build(new PatternCacheModule.Loader());
 
-  public static Repository createNewRepository(File repoFolder)
-      throws IOException {
-    Repository repository =
-        FileRepositoryBuilder.create(new File(repoFolder, ".git"));
+  public static Repository createNewRepository(File repoFolder) throws IOException {
+    Repository repository = FileRepositoryBuilder.create(new File(repoFolder, ".git"));
     repository.create();
     return repository;
   }
 
-  public static RevCommit makeCommit(RevWalk rw, Repository repo, String message,
-      Set<File> files) throws IOException, GitAPIException {
+  public static RevCommit makeCommit(RevWalk rw, Repository repo, String message, Set<File> files)
+      throws IOException, GitAPIException {
     Map<File, byte[]> tmp = new HashMap<>();
     for (File f : files) {
       tmp.put(f, null);
@@ -79,8 +76,9 @@
     return makeCommit(rw, repo, message, tmp);
   }
 
-  public static RevCommit makeCommit(RevWalk rw, Repository repo, String message,
-      Map<File, byte[]> files) throws IOException, GitAPIException {
+  public static RevCommit makeCommit(
+      RevWalk rw, Repository repo, String message, Map<File, byte[]> files)
+      throws IOException, GitAPIException {
     try (Git git = new Git(repo)) {
       if (files != null) {
         addFiles(git, files);
@@ -95,8 +93,7 @@
         .substring(1);
   }
 
-  public static void removeFiles(Git git, Set<File> files)
-      throws GitAPIException {
+  public static void removeFiles(Git git, Set<File> files) throws GitAPIException {
     RmCommand rmc = git.rm();
     for (File f : files) {
       rmc.addFilepattern(generateFilePattern(f, git));
@@ -127,39 +124,34 @@
     return MESSAGE_TRANSFORMER.apply(messages);
   }
 
-  public static List<String> transformMessages(
-      List<CommitValidationMessage> messages) {
+  public static List<String> transformMessages(List<CommitValidationMessage> messages) {
     return Lists.transform(messages, MESSAGE_TRANSFORMER);
   }
 
   public static DirCacheEntry[] createEmptyDirCacheEntries(
-      List<String> filenames, TestRepository<Repository> repo)
-      throws Exception {
+      List<String> filenames, TestRepository<Repository> repo) throws Exception {
     DirCacheEntry[] entries = new DirCacheEntry[filenames.size()];
     for (int x = 0; x < filenames.size(); x++) {
       entries[x] = createDirCacheEntry(filenames.get(x), EMPTY_CONTENT, repo);
     }
     return entries;
-
   }
 
-  public static DirCacheEntry createDirCacheEntry(String pathname,
-      byte[] content, TestRepository<Repository> repo)
-      throws Exception {
+  public static DirCacheEntry createDirCacheEntry(
+      String pathname, byte[] content, TestRepository<Repository> repo) throws Exception {
     return repo.file(pathname, repo.blob(content));
   }
 
-  public static RevCommit makeCommit(RevWalk rw, DirCacheEntry[] entries,
-      TestRepository<Repository> repo) throws Exception {
+  public static RevCommit makeCommit(
+      RevWalk rw, DirCacheEntry[] entries, TestRepository<Repository> repo) throws Exception {
     return makeCommit(rw, entries, repo, (RevCommit[]) null);
   }
 
-  public static RevCommit makeCommit(RevWalk rw, DirCacheEntry[] entries,
-      TestRepository<Repository> repo, RevCommit... parents)
+  public static RevCommit makeCommit(
+      RevWalk rw, DirCacheEntry[] entries, TestRepository<Repository> repo, RevCommit... parents)
       throws Exception {
     final RevTree ta = repo.tree(entries);
-    RevCommit c =
-        (parents == null) ? repo.commit(ta) : repo.commit(ta, parents);
+    RevCommit c = (parents == null) ? repo.commit(ta) : repo.commit(ta, parents);
     repo.parseBody(c);
     return rw.parseCommit(c);
   }