Apply recent changes to internal version here.

Add more known licenses.

Add support for .pom files.

Improve coverage etc.

Change-Id: I90868950930b3a4df1b119c58d47dce0e2d714c3
diff --git a/BUILD b/BUILD
index 43871b1..b101fe9 100644
--- a/BUILD
+++ b/BUILD
@@ -80,7 +80,7 @@
 
 sh_test(
     name = "AndroidScanTest",
-    size = "small",
+    size = "medium",
     srcs = ["src/test/java/com/googlesource/gerrit/plugins/copyright/tools/AndroidScanTest.sh"],
     data = [
         ":android_scan",
diff --git a/src/main/java/com/googlesource/gerrit/plugins/copyright/lib/CopyrightPatterns.java b/src/main/java/com/googlesource/gerrit/plugins/copyright/lib/CopyrightPatterns.java
index d2bf243..ba0cd6e 100644
--- a/src/main/java/com/googlesource/gerrit/plugins/copyright/lib/CopyrightPatterns.java
+++ b/src/main/java/com/googlesource/gerrit/plugins/copyright/lib/CopyrightPatterns.java
@@ -43,9 +43,9 @@
   public static final int MAX_DATE_REPETITION = 30;
 
   /** Regular expression matching whitespace or a comment character. */
-  public static final String WS = "[\\s*/#]";
+  public static final String WS = "[\\p{Z}\\s*/#·§­¶ ]";
   /** Regular expression matching whitespace, a comment character, or punctuation. */
-  public static final String WSPCT = "[-,;.\\s*/#]";
+  public static final String WSPCT = "[-,;.\\p{Z}\\s*/#·§­¶ ]";
   /** Regular expression matching a text character. */
   public static final String NAME_CHAR = "[-\\p{L}\\p{N}]"; // \p{L}->letter, \p{N}->numeral
   /** Regular expression matching an UPPER CASE text character. */
@@ -101,8 +101,47 @@
   /** Regular expression matching any text, email address, or quoted string. */
   public static final String ANY_WORD = "(?:" + ANY_CHAR + "{1," + MAX_NAME_LENGTH + "})";
 
+  /** Academic Freedom License Version 2.1 */
+  public static final Rule AFL2_1 =
+      license(
+          ImmutableList.of(
+              ".*SPDX-License-Identifier: AFL-2[.]1",
+              "<license> <name> ?AFL-2[.]1 ?</name>.*",
+              "Academic Free License 2[.]1"));
+
+  /** Academic Freedom License Version 3.0 */
+  public static final Rule AFL3_0 =
+      license(
+          ImmutableList.of(
+              ".*SPDX-License-Identifier: AFL-3[.]0",
+              "<license> <name> ?AFL-3[.]0 ?</name>.*",
+              "Academic Free Licen[cs]e 3[.]0"));
+
   /** Affero General Public License */
-  public static final Rule AGPL = license(ImmutableList.of("Affero"));
+  public static final Rule AGPL =
+      license(
+          ImmutableList.of(
+              // "Affero" appears thrice in GPL 3.0 -- match to exclude below.
+              "Use with the GNU Affero General Public License[.]?",
+              "link or combine any covered work with a work licensed under version 3 of the GNU"
+                  + " Affero General Public License into a single combined work[,.;:]?",
+              "but the special requirements of the GNU Affero General Public License,?",
+              // "Affero" appears in Mozilla Public License (MPL) -- match to exclude below.
+              "means either the GNU General Public License,?"
+                  + " Version 2[.]0,? the GNU Lesser General Public License,?"
+                  + " Version 2[.]1,? the GNU Affero General Public License,?",
+              // Otherwise, any occurrence of "Affero" suggests AGPL.
+              "Affero"),
+          ImmutableList.of(
+              // "Affero" appears thrice in GPL 3.0
+              "Use with the GNU Affero General Public License[.]?",
+              "link or combine any covered work with a work licensed under version 3 of the GNU"
+                  + " Affero General Public License into a single combined work[,.;:]?",
+              "but the special requirements of the GNU Affero General Public License,?",
+              // "Affero" appears in Mozilla Public License (MPL)
+              "means either the GNU General Public License,?"
+                  + " Version 2[.]0,? the GNU Lesser General Public License,?"
+                  + " Version 2[.]1,? the GNU Affero General Public License,?"));
 
   /** Android owned or licensed */
   public static final Rule ANDROID =
@@ -110,29 +149,59 @@
           ImmutableList.of("Android(?:-x86)? Open(?: |-)Source Project", "LK Trusty Authors"),
           ImmutableList.of("Android Software Development Kit Licen[cs]e Agreement"));
 
+  /** Apache Software License 1.1 */
+  public static final Rule APACHE1_1 =
+      license(
+          ImmutableList.of(
+              ".*SPDX-License-Identifier: Apache-1[.]1?",
+              "<license> <name> ?Apache(?: Software)?(?: Public)?(?: Licen[cs]e)?,?"
+                  + "(?: |-)1[.]1 ?</name>.*",
+              "<license> <name> ?(?:The )?Apache(?: Software)?(?: Public)?"
+                  + " Licen[cs]e,? Version 1[.]1 ?</name>.*",
+              "http://www[.]apache[.]org/licenses/LICENSE-1[.]1",
+              "(?:the )?Apache 1[.]1 Licen[cs]e",
+              ".*Licen[cs]ed under (?:both )?(?:the )?Apache Licen[cs]e,? version 1[.]1",
+              ".+Licen[cs]ed under (?:both )?(?:the )?Apache Licen[cs]e v1[.]1",
+              ".+licen[cs]ed under (?:the )?Apache 1[.]1",
+              "(?:the )?Apache(?: Software)?(?: Public)? Licen[cs]e,? Version 1[.]1",
+              "(?:the )?Apache(?: Software)?(?: Public)? Licen[cs]e,? v1[.]1",
+              "^terms of the Apache 1[.]1 licen[cs]e"));
+
   /** Apache 2 owned or licensed */
   public static final Rule APACHE2 =
       new Rule(
           ImmutableList.of(
-              ".*SPDX-License-Identifier: Apache-2.0",
               "(?:by )?(?:The )?Apache Software Foundation.?",
               "Apache Software Foundation.?"
                   + " This product includes software developed"
                   + " (?:by|at) The Apache Software Foundation"),
           ImmutableList.of(
-              "http://www[.]apache[.]org/licenses/LICENSE-2[.]0",
-              "Apache 2[.]0 Licen[cs]e",
+              ".*SPDX-License-Identifier: Apache-2[.]?[0]?",
+              "<license> <name> ?Apache(?: Software)?(?: Public)?(?: Licen[cs]e)?,?"
+                  + "(?: |-)2[.]?[0]? ?</name>.*",
+              "<license> <name> ?(?:The )?Apache(?: Software)?(?: Public)?"
+                  + " Licen[cs]e,? Version 2[.]?[0]? ?</name>.*",
+              "https?://www[.]apache[.]org/licenses/LICENSE-2[.]0",
+              "Apache 2[.]?[0]? Licen[cs]e",
               ".*Licen[cs]ed under (?:both )?(?:the )?Apache Licen[cs]e,?(?: version 2[.]?0?)?",
               ".+Licen[cs]ed under (?:both )?(?:the )?Apache Licen[cs]e v2[.]?(?:[\\p{L}\\p{N}]+)?",
-              ".+licen[cs]ed under (?:the )?Apache 2.?",
+              ".+licen[cs]ed under (?:the )?Apache 2[.]?",
               ".+licen[cs]es this file to you under (?:the )?Apache Licen[cs]e,?",
-              "Apache Licen[cs]e Version 2[.]0",
+              "Apache(?: Software)?(?: Public)? Licen[cs]e,? Version 2[.]?[0]?",
               "^apache2(?:-android)?",
               "^the apache licen[cs]e",
-              "^terms of the Apache 2 licen[cs]e",
+              "^terms of the Apache 2[.]?[0]? licen[cs]e",
               ".+under the terms of (?:either )the Apache Licen[cs]e[,.;]?"),
           ImmutableList.of("owner as \\p{Pi}?Not a Contribution[.,;:]{0,3}\\p{Pf}?"));
 
+  /** The Artistic License version 1 or 2 */
+  public static final Rule ARTISTIC_LICENSE =
+      license(
+          ImmutableList.of(
+              ".*SPDX-License-Identifier: Artistic-[12][.]?[0]?",
+              "<license> <name> ?Artistic-[12][.]?[0]? ?</name>.*",
+              "(?:The )?\\p{Pi}?Artistic Licen[cs]e\\p{Pf}?(?: [12][.]?[0]?)?"));
+
   /** The BEER-WARE License */
   public static final Rule BEER_WARE = license(ImmutableList.of("\\bTHE BEER-WARE LICEN[CS]E"));
 
@@ -140,6 +209,10 @@
   public static final Rule BSD =
       license(
           ImmutableList.of(
+              "<license> <name> ?BSD \\p{N}-clause(?: License)? ?</name>.*",
+              "<license> <name> ?BSD(?: |-)style(?: License)? ?</name>.*",
+              "<license> <name> ?(?:New )?BSD(?: New)?(?: Licen[cs]e)? ?</name>.*",
+              "<license> <name> ?Berkeley Software Distribution [(]BSD[)] Licen[cs]e ?</name>.*",
               ".*SPDX-License-Identifier: BSD-2-Clause",
               ".*SPDX-License-Identifier: BSD-2-Clause-FreeBSD",
               ".*SPDX-License-Identifier: BSD-3-Clause",
@@ -161,6 +234,36 @@
                   + " and the following disclaimer in the documentation[,.;:]? and(?: |[/])or other"
                   + " materials(?: provided with the distribution)?[,.:;]{0,3}"));
 
+  /** The Boost Software License */
+  public static final Rule BSL1_0 =
+      license(
+          ImmutableList.of(
+              ".*SPDX-License-Identifier: BSL-1[.]?0?",
+              "<license> <name> ?Boost(?:,? Version 1[.]?0?)? ?</name>.*",
+              "<license> <name> ?Boost Software License(?:,? Version 1[.]?0?)? ?</name>.*",
+              "<license> <name> ?BSL-1[.]?0? ?</name>.*",
+              "https?://www[.]boost[.]org/LICENSE_1_0[.]txt(?: [(]?Boost license[)]?)?",
+              "Boost Software License 1[.]?0?.*",
+              ".*(?:The )?Boost Software License(?:,| ?-)?(?: Version 1[.]?0?)?"));
+
+  /** Creative Commons Public Domain-like License */
+  public static final Rule CC0 =
+      license(
+          ImmutableList.of(
+              "<license> <name> ?CC0 ?</name>.*",
+              "https?://[\\p{L}\\p{N}.]*creativecommons[.]org/publicdomain/zero(?:/[\\p{N}.]*)?",
+              "To the extent possible under law[,;:]? the person who associated CC0 with this code"
+                  + " has waived all copyright and related or neighboring rights to this code[.]?",
+              "To the greatest extent permitted by,? but not in contravention of,? applicable law,?"
+                  + " Affirmer hereby overtly,? fully,? permanently,? irrevocably and"
+                  + " unconditionally waives,? abandons,? and surrenders all of Affirmer'?s"
+                  + " Copyright and Related Rights and associated claims and causes of action,?"
+                  + " whether (?:now )?known or unknown",
+              "Affirmer hereby grants to each affected person a royalty-?free,?"
+                  + " non(?: |-)?transferable,? non(?: |-)?sublicensable,? non(?: |-)?exclusive,?"
+                  + " irrevocable,? and unconditional license to exercise Affirmer'?s Copyright"
+                  + " and Related Rights in the Work"));
+
   /** Creative Commons Attribution -- allows commercial */
   public static final Rule CC_BY_C =
       license(
@@ -177,17 +280,34 @@
               "\\bAttribution(?:-NoDerivs)?(?:-Share ?Alike)?"
                   + "-NonCommercial(?:-NoDerivs)?(?:-Share ?Alike)?"));
 
-  /** Commons Cause License */
-  public static final Rule COMMONS_CAUSE = license(ImmutableList.of("\\bCommons Clause"));
+  /** Clang/LLVM License (NCSA version of MIT) */
+  public static final Rule CLANG_LLVM =
+      license(
+          ImmutableList.of(
+              "This file is dual licensed under the MIT and the University of Illinois Open"
+                  + " Source Licenses[,.;:]?",
+              "to deal with the Software without restriction,? including without limitation"));
+
+  /** Commons Clause License */
+  public static final Rule COMMONS_CLAUSE = license(ImmutableList.of("\\bCommons Clause"));
 
   /** Common Public Attribution License */
   public static final Rule CPAL =
       license(ImmutableList.of("\\bCommon Public Attribution Licen[cs]e"));
 
+  /** Eclipse Distribution License (basically BSD 3-clause plus below) */
+  public static final Rule EDL =
+      license(
+          ImmutableList.of(
+              "https?://www[.]eclipse[.]org/org/documents/edl-v10[.]php",
+              "Eclipse Distribution Licen[cs]e(?: -)? v? ?1[.]0"));
+
   /** Eclipse Public License */
   public static final Rule EPL =
       license(
           ImmutableList.of(
+              "<license> <name> ?Eclipse Public Licen[cs]e"
+                  + "(?: -)?(?: (?:v ?|version )?1[.]?[0]?)? ?</name>.*",
               "^Eclipse Public Licen[cs]e[.]?",
               ".*under (?:(?:the|this) )?(?:terms of )?(?:the )?eclipse"
                   + " (?:public )?licen[cs]e[,.;:]?.*",
@@ -197,10 +317,28 @@
   public static final Rule EUPL = license(ImmutableList.of(" [(]?EUPL[)]? "));
 
   /** Appears in tests similar to using example.com as a test domain */
-  public static final Rule EXAMPLES = owner(ImmutableList.of("Your Company."));
+  public static final Rule EXAMPLES = owner(ImmutableList.of("Your Company[.]?"));
+
+  /** FreeType Project License */
+  public static final Rule FTL =
+      new Rule(
+          ImmutableList.of("The FreeType ProjectI(?: [(]?www[.]freetype[.]org[)]?)[,;:.]?"),
+          ImmutableList.of(
+              ".*SPDX-License-Identifier: FTL",
+              "<license> <name> ?(?:The )?Freetype Project ?</name>.*",
+              "<license> <name> ?FTL ?</name>.*",
+              "This license was inspired by the BSD,? Artistic,? and IJG [(]?Independent JPEG"
+                  + " Group[)]? licenses,? which all encourage inclusion and use of free software"
+                  + " in commercial and freeware products alike[,;:.]?",
+              "you must acknowledge somewhere in your documentation that you have used the FreeType"
+                  + " code[.;:.]?",
+              "The FreeType Project LICENSE",
+              "The FreeType Project is distributed in several archive packages[,;.:]?",
+              "This file is part of the FreeType project,? and may only be used,? modified,? and"
+                  + " distributed under the terms of the FreeType project license[,.;:]?"));
 
   /** Google owned */
-  public static final Rule GOOGLE = owner(ImmutableList.of("Google,? Inc."));
+  public static final Rule GOOGLE = owner(ImmutableList.of("Google,? Inc[.]?", "Google LLC"));
 
   /** Generic GNU General Public License */
   public static final Rule GPL =
@@ -218,6 +356,9 @@
   public static final Rule GPL2 =
       license(
           ImmutableList.of(
+              "<license> <name> ?GNU General Public License, Version 2 ?</name>.*",
+              "<license> <name> ?The GPLv2 License ?</name>.*",
+              "<license> <name> ?GPLv2 ?</name>.*",
               ".*SPDX-License-Identifier: GPL-2.0[+]?",
               ".*SPDX-License-Identifier: GPL-2.0-only",
               ".*SPDX-License-Identifier: GPL-2.0-or-later",
@@ -235,6 +376,7 @@
   public static final Rule GPL3 =
       license(
           ImmutableList.of(
+              "<license> <name> ?GPLv3 ?</name>.*",
               ".*SPDX-License-Identifier: GPL-3.0[+]?",
               ".*[\\[]?GNU[\\]]? GPL[,;]? version 3[,.;:]?.*",
               ".*[\\[]?GNU[\\]]? General Public Licen[cs]e[,;]? version 3[,.;:]?.*",
@@ -246,18 +388,64 @@
               "See the [\\[]?GNU[\\]]? General Public Licen[cs]e for more details[,.;:]?",
               "In addition to the permissions in the GNU General Public License[,.;:]?"));
 
+  /** The ISC License */
+  public static final Rule ISC =
+      license(
+          ImmutableList.of(
+              "<license> <name> ?(?:The )?ISC(?: Licen[cs]e)? ?</name>.*",
+              ".*SPDX-License-Identifier: ISC",
+              "https?://(?:www[.])?spdx[.]org/licenses/ISC",
+              "(?:The )?ISC Licen[cs]e",
+              "Files that are completely new have a Google copyright and an ISC license[,;:.]?",
+              "ISC license used for completely new code in BoringSSL[,.;:]?",
+              "this file is available under an ISC license[,;:.]?",
+              "ISC"));
+
+  /** The JSON License (MIT plus the sentence below) */
+  public static final Rule JSON =
+      license(ImmutableList.of("The Software shall be used for Good,? not Evil[.]?"));
+
   /** GNU Lessor or Library General Public License */
   public static final Rule LGPL =
       license(
           ImmutableList.of(
+              "<license> <name> ?GNU (?:Lesser|Library) General Public License ?</name>.*",
               ".*SPDX-License-Identifier: LGPL.*",
               ".*LGPL.*",
               ".*gnu (?:library|lesser) general public licen[cs]e.*"));
 
+  /** LibTIFF Library */
+  public static final Rule LIBTIFF =
+      license(
+          ImmutableList.of(
+              "<license> <name> ?libtiff(?: license)? ?</name>.*",
+              ".*SPDX-License-Identifier: libtiff",
+              "https?://(?:www[.])?fedoraproject[.]org/wiki/Licensing/libtiff",
+              "Permission to use,? copy,? modify,? distribute,? and sell this software and its"
+                  + " documentation for any purpose is hereby granted without fee,? provided that"
+                  + " [(]i[)] the above copyright notices and this permission notice appear in all"
+                  + " copies of the software and related documentation,? and [(]ii[)] the names of"
+                  + " Sam Leffler and Silicon Graphics may not be used in any advertising"));
+
+  /** Lucent Public License v 1.02 */
+  public static final Rule LPL1_02 =
+      license(
+          ImmutableList.of(
+              "<license> <name> ?LPL-1[.]02 ?</name>.*",
+              ".*SPDX-License-Identifier: LPL-1[.]02",
+              "https?://plan9[.]bell-labs[.]com/plan9dist/license[.]html",
+              "https?://(?:www[.])?opensource[.]org/licenses/LPL-1[.]02",
+              "This software is (?:also )?made available under the Lucent Public License,? version"
+                  + " 1[.]02",
+              "Lucent Public License,? version 1[.]02",
+              "Lucent Public License v1[.]02"));
+
   /** MIT licensed */
   public static final Rule MIT =
       license(
           ImmutableList.of(
+              "<license> <name> ?(?:The )?MIT Licen[cs]e(?: [(]MIT[)])? ?</name>.*",
+              "<license> <name> ?MIT ?</name>.*",
               ".*SPDX-License-Identifier: MIT",
               "http://www.opensource.org/licenses/mit-license.php",
               "^the mit licen[cs]e(?:[:] http://www.opensource.org/licenses/mit-license.php)?",
@@ -292,6 +480,27 @@
                   + " redistribute this software[,;]? in source or binary form[,;]? provided that"
                   + " the above copyright notice and the following disclaimer are included.*"));
 
+  /** Microsoft Public License */
+  public static final Rule MSPL =
+      license(
+          ImmutableList.of(
+              "<license> <name> ?(?:The )?Microsoft Public Licen[cs]e ?</name>.*",
+              "<license> <name> ?MS-PL ?</name>.*",
+              ".*SPDX-License-Identifier: MS-PL"));
+
+  /** NCSA License */
+  public static final Rule NCSA =
+      license(
+          ImmutableList.of(
+              "<license> <name> ?NCSA ?</name>.*",
+              ".*SPDX-License-Identifier: NCSA",
+              "https?://otm[.]illinois[.]edu/uiuc_openSource",
+              "https?://(?:www[.])?opensource[.]org/licenses/NCSA",
+              "University of Illinois[/]NCSA Open Source Licen[cs]e",
+              "University of Illinois NCSA Open Source Licen[cs]e",
+              "Redistributions of source code must retain the above copyright notice,? this list of"
+                  + " conditions and the following disclaimers[,;:.]?"));
+
   /** Generic non-commercial disclaimer. */
   public static final Rule NON_COMMERCIAL =
       license(ImmutableList.of("\\bNON-?COMMERCIAL LICEN[CS]E"));
@@ -306,6 +515,23 @@
                   + "Not a Contribution[.,;:]{0,3}\\p{Pf}?.*"), // explicitly disclaims license
           ImmutableList.of("owner as \\p{Pi}?Not a Contribution[.,;:]{0,3}\\p{Pf}?"));
 
+  /** OpenSSL License */
+  public static final Rule OPENSSL =
+      new Rule(
+          ImmutableList.of("The OpenSSL Project[,.;:]?"),
+          ImmutableList.of(
+              "<license> <name> ?OpenSSL ?</name>.*",
+              ".*SPDX-License-Identifier: OpenSSL",
+              "https?://(?:www[.])?openssl[.]org/source/license[.]html",
+              "Licensed under the OpenSSL license(?: [(]?the \\p{Pi}?License\\p{Pf}?[)]?)?[,.;:]?",
+              "\\p{Pi}?This product includes software developed by the OpenSSL Project for use in"
+                  + " the OpenSSL Toolkit[,;:.]?"
+                  + "(?: [(]?https?://(?:www[.])?openssl[.]org(?:/| )?[)]?\\p{Pf}?)?",
+              "The names \\p{Pi}?OpenSSL Toolkit\\p{Pf}? and \\p{Pi}?OpenSSL Project\\p{Pf}? must"
+                  + " not be used to endorse or promote",
+              "Original SSLeay License",
+              "OpenSSL License"));
+
   /** Python Software Foundation */
   public static final Rule PSF = owner(ImmutableList.of("Python Software Foundation"));
 
@@ -313,6 +539,7 @@
   public static final Rule PSFL =
       license(
           ImmutableList.of(
+              "(?:The )?PSF Licen[cs]e",
               ".*Python Software Foundation license(?: version \\p{N})?[,.;:]?.*",
               ".*Permission to use[,;]? copy[,;]? modify[,;]? and distribute this Python software"
                   + " and its associated documentation for any purpose.*"));
@@ -321,10 +548,91 @@
   public static final Rule SISSL =
       license(ImmutableList.of("\\bSun Industry Standards Source Licen[cs]e"));
 
+  /** Server Side Public License */
+  public static final Rule SSPL =
+      license(
+          ImmutableList.of(
+              ".*Server Side Public Licen[cs]e.*",
+              ".*SPDX-License-Identifier: SSPL-1[.]0",
+              "\\p{Pi}?This License\\p{Pf}? refers to (?:the )?Server Side Public License[,;:.]?",
+              "If you make the functionality of the Program (?:or a modified version )?available to"
+                  + " third parties as a service,? you must make the Service Source Code available",
+              "\\p{Pi}?Service Source Code\\p{Pf}? means the Corresponding Source for the Program"
+                  + "(?: or the modified version),? and the Corresponding Source for all programs"
+                  + " that you use to make the Program",
+              "(?:https?://)?(?:www[.])?mongodb[.]com/licensing/server-side-public-license",
+              "SSPL-\\p{N}[.]?\\p{N}?",
+              "This program is free software[,.;:]? you can redistribute it and/or modify it under"
+                  + " the terms of the Server Side Public License.*",
+              "You must comply with the Server Side Public License in all respects"));
+
+  /** Unicode Data Files and Software/Terms of Use */
+  public static final Rule UNICODE =
+      license(
+          ImmutableList.of(
+              ".*SPDX-License-Identifier: Unicode-DFS-\\p{N}{4}",
+              ".*SPDX-License-Identifier: Unicode-TOU",
+              "https?://(?:www[.])?unicode[.]org/copyright[.]html",
+              "UNICODE,? INC[.]? LICENSE AGREEMENT(?: -)? DATA FILES AND SOFTWARE",
+              "Permission is hereby granted,? free of charge,? to any person obtaining a copy of"
+                  + " the Unicode data files and any associated documentation",
+              "Certain documents and files on this website contain a legend indicating that"
+                  + " \\p{Pi}?Modification is permitted[,;:.]?\\p{Pf}?",
+              "the particular set of data files known as the \\p{Pi}?Unicode Character"
+                  + " Database\\p{Pf}? can be found in",
+              "Each version of the Unicode Standard has further specifications of rights and"
+                  + " restrictions of use[,;:.]?",
+              "Unicode License Agreement(?: -)? Data Files and Software(?: [(]?\\p{N}{4}[)]?)?",
+              "Unicode Terms of Use"));
+
+  /** Unlicense (public domain) */
+  public static final Rule UNLICENSE =
+      license(
+          ImmutableList.of(
+              ".*SPDX-License-Identifier: Unlicen[cs]e",
+              "<license> <name> ?Unlicen[cs]e ?</name>.*",
+              "This is free and unencumbered software released into the public domain[,;:.]?",
+              "the author (?:or authors )?of this software dedicate any and all copyright interest"
+                  + " in the software to the public domain[,;:.]?",
+              "(?:https?://)?(?:www[.])?unlicen[cs]e[.]org(?:/UNLICEN[CS]E)?"));
+
+  /** Universal Permissive License */
+  public static final Rule UPL =
+      license(
+          ImmutableList.of(
+              "<license> <name> ?UPL(?:-1[.]0)? ?</name>.*",
+              ".*SPDX-License-Identifier: UPL-1[.]0",
+              "Universal Permissive License v1[.]0",
+              "The above copyright notice and either this complete permission notice or at a"
+                  + " minimum a reference to the UPL must be included in all copies",
+              "The Universal Permissive License(?: [(]?UPL[)]?)?,?(?: Version 1[.]0)?"));
+
+  /** W3C Software Notice and License */
+  public static final Rule W3C =
+      new Rule(
+          ImmutableList.of(
+              "World Wide Web Consortium[,.;:]?",
+              "Massachusetts Institute of Technology,? European Research Consortium for Informatics"
+                  + " and Mathematics, Keio University"),
+          ImmutableList.of(
+              ".*SPDX-License-Identifier: W3C(?:-(?:19980720|20021231|20150513))?",
+              "<license> <name> ? W3C(?:-(?:19980720|20021231|20150513))? ?</name>.*",
+              "https?://(?:www[.])?opensource[.]org/licenses/W3C",
+              "https?://(?:www[.])?w3[.]org/Consortium/Legal/copyright-software-19980720[.]html",
+              "https?://(?:www[.])?w3[.]org/Consortium/Legal/2002"
+                  + "/copyright-software-20021231[.]html",
+              "https?://(?:www[.])?w3[.]org/Consortium/Legal/2015/copyright-software-and-document",
+              "If none exist,? a short notice of the following form",
+              "If none exist,? the W3C Software Short Notice should be included",
+              "If none exist,? the W3C Software and Document Short Notice should be included[.]?",
+              "W3C(?:®|[(]R[)])? SOFTWARE (?:NOTICE AND )?LICEN[CS]E"
+                  + "(?: [(]?(?:1998-07-20|2002-12-31|2015-05-13)[)]?)?"));
+
   /** Watcom-1.0 license */
   public static final Rule WATCOM =
       license(
           ImmutableList.of(
+              ".*SPDX-License-Identifier: Watcom-1[.]0",
               ".*Sybase Open Watcom Public License.*",
               ".*automatically without notice if You[,;]? at any time during the term of this"
                   + " Licen[cs]e[,;]? commence an action for patent infringement [(]?including as a"
@@ -332,36 +640,121 @@
 
   /** Do What The Fuck You Want To Public License */
   public static final Rule WTFPL =
-      license(ImmutableList.of("\\bDo What The Fuck You Want To Public Licen[cs]e"));
+      license(
+          ImmutableList.of(
+              "<license> <name> ?WTFPL ?</name>.*",
+              ".*SPDX-License-Identifier: WTFPL",
+              "\\bDo What The F.ck You Want To Public Licen[cs]e"));
+
+  /** X.Net License */
+  public static final Rule XNET =
+      license(
+          ImmutableList.of(
+              "<license> <name> ?X[.]Net(?: Licen[cs]e)? ?</name>.*",
+              "<license> <name> ?Xnet ?</name>.*",
+              ".*SPDX-License-Identifier: Xnet",
+              "https?://(?:www[.])?opensource[.]org/licenses/Xnet",
+              "X.Net Licen[cs]e"));
+
+  /** Zend Engine License version 2.00 */
+  public static final Rule ZEND =
+      license(
+          ImmutableList.of(
+              "<license> <name> ?Zend(?: Engine)? License(?: (?:v|version )2[.]00?)? ?</name>.*",
+              "<license> <name> ?Zend(?:-2[.]00?)? ?</name>.*",
+              ".*SPDX-License-Identifier: Zend-2[.]0",
+              "https?://(?:www[.])?zend[.]com/license/2_00[.]txt",
+              "Zend (?:Engine )?License,? v2[.]00?",
+              "The Zend Engine License,? version 2[.]00?"));
+
+  /** Zlib/libpng License */
+  public static final Rule ZLIB =
+      license(
+          ImmutableList.of(
+              "<license> <name> ?zlib Licen[cs]e ?</name>.*",
+              "<license> <name> ?zlib/libpng Licen[cs]e(?: with Acknowledgement)? ?</name>.*",
+              ".*SPDX-License-Identifier: Zlib",
+              ".*SPDX-License-Identifier: zlib-acknowledgement",
+              "https?://(?:www[.])?opensource[.]org/licenses/zlib-license[.]php",
+              "https?://(?:www[.])?zlib[.]net/zlib_license[.]html",
+              "https?://(?:www[.])?opensource[.]org/licenses/Zlib",
+              "https?://(?:www[.])?fedoraproject[.]org/wiki/Licensing/ZlibWithAcknowledgement",
+              "Permission is granted to anyone to use this software for any purpose,? including"
+                  + " commercial applications,? and to alter it and redistribute it freely,?"
+                  + " subject to the following restrictions[,.;:]?",
+              "(?:The )?zlib/libpng License(?: with Acknowledgement)?",
+              "(?:The )?zlib/libpng License [(]Zlib[)]",
+              "zlib licen[cs]e"));
+
+  /** Zope Public License */
+  public static final Rule ZPL =
+      license(
+          ImmutableList.of(
+              "<license> <name> ?Zope Public License,?(?: version \\p{N}[.]?\\p{N}?)? ?</name>.*",
+              "<license> <name> ?ZPL-\\p{N}[.]?\\p{N}? ?</name>.*",
+              ".*SPDX-License-Identifier: ZPL-\\p{N}[.]?\\p{N}?",
+              "https?://(?:www[.])?opensource[.]org/licenses/ZPL-\\p{N}[.]?\\p{N}?",
+              "This product includes software developed by Zope Corporation",
+              "Names associated with Zope or Zope Corporation must not be used",
+              "The name Zope Corporation ?[(]tm[)] must not be used",
+              "Names of the copyright holders must not be used to endorse or promote products"
+                  + " derived from this software without prior written permission from the"
+                  + " copyright holders[,;:.]?",
+              "Zope Public License(?: [(]?ZPL[)]?)?(?: Version)?(?: \\p{N}[.]?\\p{N}?)?"));
 
   @VisibleForTesting
   static ImmutableMap<String, Rule> lookup =
       ImmutableMap.<String, Rule>builder()
+          .put("AFL2.1", AFL2_1)
+          .put("AFL3.0", AFL3_0)
           .put("AGPL", AGPL)
           .put("ANDROID", ANDROID)
+          .put("APACHE1.1", APACHE1_1)
           .put("APACHE2", APACHE2)
+          .put("ARTISTIC_LICENSE", ARTISTIC_LICENSE)
           .put("BEER_WARE", BEER_WARE)
+          .put("BOOST", BSL1_0)
           .put("BSD", BSD)
+          .put("BSL1.0", BSL1_0)
+          .put("CC0", CC0)
           .put("CC_BY_C", CC_BY_C)
           .put("CC_BY_NC", CC_BY_NC)
-          .put("COMMONS_CLAUSE", COMMONS_CAUSE)
+          .put("CLANG_LLVM", CLANG_LLVM)
+          .put("COMMONS_CLAUSE", COMMONS_CLAUSE)
           .put("CPAL", CPAL)
+          .put("EDL", EDL)
           .put("EPL", EPL)
           .put("EUPL", EUPL)
           .put("EXAMPLES", EXAMPLES)
+          .put("FTL", FTL)
           .put("GOOGLE", GOOGLE)
           .put("GPL", GPL)
           .put("GPL2", GPL2)
           .put("GPL3", GPL3)
+          .put("JSON", JSON)
           .put("LGPL", LGPL)
+          .put("LIBTIFF", LIBTIFF)
+          .put("LPL1.02", LPL1_02)
           .put("MIT", MIT)
+          .put("MS-PL", MSPL)
+          .put("NCSA", NCSA)
           .put("NON_COMMERCIAL", NON_COMMERCIAL)
           .put("NOT_A_CONTRIBUTION", NOT_A_CONTRIBUTION)
+          .put("OPENSSL", OPENSSL)
           .put("PSF", PSF)
           .put("PSFL", PSFL)
           .put("SISSL", SISSL)
+          .put("SSPL", SSPL)
+          .put("UNLICENSE", UNLICENSE)
+          .put("UNICODE", UNICODE)
+          .put("UPL", UPL)
+          .put("W3C", W3C)
           .put("WATCOM", WATCOM)
           .put("WTFPL", WTFPL)
+          .put("XNET", XNET)
+          .put("ZEND", ZEND)
+          .put("ZLIB", ZLIB)
+          .put("ZPL", ZPL)
           .build();
 
   /** Immutable set of copyright rules described as lists of regular expression strings. */
diff --git a/src/main/java/com/googlesource/gerrit/plugins/copyright/lib/CopyrightScanner.java b/src/main/java/com/googlesource/gerrit/plugins/copyright/lib/CopyrightScanner.java
index 736a537..abcce95 100644
--- a/src/main/java/com/googlesource/gerrit/plugins/copyright/lib/CopyrightScanner.java
+++ b/src/main/java/com/googlesource/gerrit/plugins/copyright/lib/CopyrightScanner.java
@@ -140,6 +140,7 @@
    */
   private static final ImmutableList<String> CONTRACT_WORDS =
       ImmutableList.of(
+          "license>[-\\s\\p{Z}\\p{L}\\p{N}\\p{P}\\p{S}\\p{M}<>/#*.]{1,512}?</[^>]{0,25}licen[cs]e",
           "agree(?:s|d|ment)?",
           "amendments?",
           "applicable laws?",
@@ -692,12 +693,13 @@
     sb.append(NAME);
     sb.append(WS);
     sb.append(
-        "{1,msl}){2,mnr}?licen[cs]e))[,.;]{0,3}(?![:])"); // end of 1st or 2nd captured match group
+        "{1,msl}){1,mnr}?licen[cs]e))[,.;]{0,3}(?![:])"); // end of 1st or 2nd captured match group
 
     // Other license captures. -- Line starting with License:
-    sb.append("|(?-ms:licen[cs]e:\\s{1,msl}("); // start of the 2nd or 3rd captured match group
+    sb.append(
+        "|(?-ms:licen[cs]e:[\\p{Z}\\s]{1,msl}("); // start of the 2nd or 3rd captured match group
     sb.append(NAME);
-    sb.append("(?:\\s{1,msl}");
+    sb.append("(?:[\\p{Z}\\s]{1,msl}");
     sb.append(NAME);
     sb.append("){0,mnr})\\n)"); // end of 2nd or 3rd captured match group
 
@@ -784,13 +786,13 @@
     sb.append(")){0,5}"); // captures 0 to 5 additional author/owner declarations
 
     // Detect contract words to detect unknown licenses.
-    sb.append("|(?:(?:\\b|\\p{Pi})(?:"); // unknown licenses use non-capturing group
+    sb.append("|(?:(?:[<\\p{Pi}]|\\b)(?:"); // unknown licenses use non-capturing group
     sb.append(words);
     sb.append(")(?:");
     sb.append(WS);
     sb.append("(?:");
     sb.append(words);
-    sb.append(")){0,mnr}(?:\\b|[,.;:\\p{Pf}]))");
+    sb.append(")){0,mnr}(?:[>,.;:\\p{Pf}]|\\b))");
 
     return Pattern.compile(
         sb.toString()
@@ -894,7 +896,7 @@
         "Capturing group found in /" + match + "/. Use non-capturing (?:...) instead of (...).");
     // Disallow spaces inside character classes because they will get replaced.
     Preconditions.checkArgument(
-        !match.matches(".*\\[[^]]*\\s[]].*"),
+        !match.matches(".*\\[[^]]*[\\s\\p{Z}][]].*"),
         "Character class with space in /" + match + "/. Use (?: |...) instead of space in [...].");
     // Replace unlimited "any char" wildcards that can cost too much backtracking with patterns that
     // match a smaller subset of characters with more limited quantifiers.
@@ -937,8 +939,10 @@
                             + MAX_NAME_REPETITION
                             + "}")
                         .replace("\\", "\\\\"))
-                .replaceAll("\\s+[?]", WS.replace("\\", "\\\\") + "{0," + MAX_SPACE_LENGTH + "}")
-                .replaceAll("\\s+", WS.replace("\\", "\\\\") + "{1," + MAX_SPACE_LENGTH + "}")
+                .replaceAll(
+                    "[\\s\\p{Z}]+[?]", WS.replace("\\", "\\\\") + "{0," + MAX_SPACE_LENGTH + "}")
+                .replaceAll(
+                    "[\\s\\p{Z}]+", WS.replace("\\", "\\\\") + "{1," + MAX_SPACE_LENGTH + "}")
             + suffix,
         Pattern.CASE_INSENSITIVE | Pattern.MULTILINE | Pattern.UNICODE_CASE | Pattern.DOTALL);
   }
@@ -952,7 +956,7 @@
       return null;
     }
     StringBuilder sb = new StringBuilder();
-    Matcher m = Pattern.compile(URL).matcher(match);
+    Matcher m = Pattern.compile(URL + "|[<][/]").matcher(match); // URL or end-tag
     int nextIndex = 0;
     while (m.find()) {
       int start = m.start();
diff --git a/src/main/java/com/googlesource/gerrit/plugins/copyright/tools/AndroidScan.java b/src/main/java/com/googlesource/gerrit/plugins/copyright/tools/AndroidScan.java
index 37fed5e..dbcbe65 100644
--- a/src/main/java/com/googlesource/gerrit/plugins/copyright/tools/AndroidScan.java
+++ b/src/main/java/com/googlesource/gerrit/plugins/copyright/tools/AndroidScan.java
@@ -31,25 +31,51 @@
             .addFirstParty("GOOGLE")
             .addFirstParty("EXAMPLES")
             // 3p
+            .addThirdParty("AFL2.1")
+            .addThirdParty("AFL3.0")
+            .addThirdParty("APACHE1.1")
+            .addThirdParty("ARTISTIC_LICENSE")
             .addThirdParty("BSD")
-            .addThirdParty("MIT")
+            .addThirdParty("BSL1.0")
+            .addThirdParty("CC0")
+            .addThirdParty("CLANG_LLVM")
+            .addThirdParty("EDL")
             .addThirdParty("EPL")
+            .addThirdParty("FTL")
             .addThirdParty("GPL2")
             .addThirdParty("GPL3")
+            .addThirdParty("JSON")
+            .addThirdParty("LIBTIFF")
+            .addThirdParty("LPL1.02")
+            .addThirdParty("MIT")
+            .addThirdParty("MS-PL")
+            .addThirdParty("NCSA")
+            .addThirdParty("OPENSSL")
             .addThirdParty("PSFL")
+            .addThirdParty("UNLICENSE")
+            .addThirdParty("UNICODE")
+            .addThirdParty("W3C")
+            .addThirdParty("XNET")
+            .addThirdParty("ZEND")
+            .addThirdParty("ZPL")
+            .addThirdParty("ZLIB")
             // Forbidden
             .addForbidden("AGPL")
-            .addForbiddenLicense(".*(?:Previously|formerly) licen[cs]ed under.*")
-            .addForbidden("NOT_A_CONTRIBUTION")
-            .addForbidden("WTFPL")
             .addForbidden("BEER_WARE")
-            .addForbidden("CC_BY_NC")
-            .addForbidden("NON_COMMERCIAL")
-            .addForbidden("COMMONS_CLAUSE")
-            .addForbidden("WATCOM")
             .addForbidden("CC_BY_C")
-            .addForbidden("LGPL")
+            .addForbidden("CC_BY_NC")
+            .addForbidden("COMMONS_CLAUSE")
+            .addForbidden("CPAL")
+            .addForbidden("EUPL")
             .addForbidden("GPL")
+            .addForbidden("LGPL")
+            .addForbidden("NON_COMMERCIAL")
+            .addForbidden("NOT_A_CONTRIBUTION")
+            .addForbiddenLicense(".*(?:Previously|formerly) licen[cs]ed under.*")
+            .addForbidden("SISSL")
+            .addForbidden("SSPL")
+            .addForbidden("WATCOM")
+            .addForbidden("WTFPL")
             .build();
 
     ScanTool.main(args);
diff --git a/src/test/java/com/googlesource/gerrit/plugins/copyright/testdata/licenses/AFL2_1.txt b/src/test/java/com/googlesource/gerrit/plugins/copyright/testdata/licenses/AFL2_1.txt
new file mode 100644
index 0000000..568fd57
--- /dev/null
+++ b/src/test/java/com/googlesource/gerrit/plugins/copyright/testdata/licenses/AFL2_1.txt
@@ -0,0 +1,5 @@
+/*
+ * License: Academic Free License 2.1
+ *
+ * SPDX-License-Identifier: AFL-2.1
+ */
diff --git a/src/test/java/com/googlesource/gerrit/plugins/copyright/testdata/licenses/AFL3_0.txt b/src/test/java/com/googlesource/gerrit/plugins/copyright/testdata/licenses/AFL3_0.txt
new file mode 100644
index 0000000..71e4728
--- /dev/null
+++ b/src/test/java/com/googlesource/gerrit/plugins/copyright/testdata/licenses/AFL3_0.txt
@@ -0,0 +1 @@
+<bottom><![CDATA[<em>Licence</em>: <strong>Academic Free License 3.0</strong>]]></bottom>
diff --git a/src/test/java/com/googlesource/gerrit/plugins/copyright/testdata/licenses/APACHE1_1.txt b/src/test/java/com/googlesource/gerrit/plugins/copyright/testdata/licenses/APACHE1_1.txt
new file mode 100644
index 0000000..552d9bd
--- /dev/null
+++ b/src/test/java/com/googlesource/gerrit/plugins/copyright/testdata/licenses/APACHE1_1.txt
@@ -0,0 +1,57 @@
+/* ====================================================================
+ * The Apache Software License, Version 1.1
+ *
+ * Copyright (c) 2000 The Apache Software Foundation.  All rights
+ * reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ *
+ * 3. The end-user documentation included with the redistribution,
+ *    if any, must include the following acknowledgment:
+ *       "This product includes software developed by the
+ *        Apache Software Foundation (http://www.apache.org/)."
+ *    Alternately, this acknowledgment may appear in the software itself,
+ *    if and wherever such third-party acknowledgments normally appear.
+ *
+ * 4. The names "Apache" and "Apache Software Foundation" must
+ *    not be used to endorse or promote products derived from this
+ *    software without prior written permission. For written
+ *    permission, please contact apache@apache.org.
+ *
+ * 5. Products derived from this software may not be called "Apache",
+ *    nor may "Apache" appear in their name, without prior written
+ *    permission of the Apache Software Foundation.
+ *
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * ====================================================================
+ *
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation.  For more
+ * information on the Apache Software Foundation, please see
+ * <http://www.apache.org/>.
+ *
+ * Portions of this software are based upon public domain software
+ * originally written at the National Center for Supercomputing Applications,
+ * University of Illinois, Urbana-Champaign.
+ */
diff --git a/src/test/java/com/googlesource/gerrit/plugins/copyright/testdata/licenses/ARTISTIC_LICENSE.txt b/src/test/java/com/googlesource/gerrit/plugins/copyright/testdata/licenses/ARTISTIC_LICENSE.txt
new file mode 100644
index 0000000..04c81bc
--- /dev/null
+++ b/src/test/java/com/googlesource/gerrit/plugins/copyright/testdata/licenses/ARTISTIC_LICENSE.txt
@@ -0,0 +1,2 @@
+Permission is granted to copy, distribute and/or modify this document
+under the terms of the Artistic License 2.0.
diff --git a/src/test/java/com/googlesource/gerrit/plugins/copyright/testdata/licenses/BSL1_0.txt b/src/test/java/com/googlesource/gerrit/plugins/copyright/testdata/licenses/BSL1_0.txt
new file mode 100644
index 0000000..8e8bf0c
--- /dev/null
+++ b/src/test/java/com/googlesource/gerrit/plugins/copyright/testdata/licenses/BSL1_0.txt
@@ -0,0 +1,5 @@
+//  Copyright (C) 9999 J Doe
+
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
diff --git a/src/test/java/com/googlesource/gerrit/plugins/copyright/testdata/licenses/CC0.txt b/src/test/java/com/googlesource/gerrit/plugins/copyright/testdata/licenses/CC0.txt
new file mode 100644
index 0000000..a70b2ac
--- /dev/null
+++ b/src/test/java/com/googlesource/gerrit/plugins/copyright/testdata/licenses/CC0.txt
@@ -0,0 +1,6 @@
+/*
+ * Written by People with assistance from members of Some Organization
+ * released to the public domain, as explained at
+ * http://creativecommons.org/publicdomain/zero/1.0/
+ * Other contributors include Other People
+ */
diff --git a/src/test/java/com/googlesource/gerrit/plugins/copyright/testdata/licenses/EDL.txt b/src/test/java/com/googlesource/gerrit/plugins/copyright/testdata/licenses/EDL.txt
new file mode 100644
index 0000000..de59991
--- /dev/null
+++ b/src/test/java/com/googlesource/gerrit/plugins/copyright/testdata/licenses/EDL.txt
@@ -0,0 +1 @@
+Eclipse Distribution License - v1.0 ([license/third_party/testdata/eclipse_distribution_license.txt][eclipse-distribution])
diff --git a/src/test/java/com/googlesource/gerrit/plugins/copyright/testdata/licenses/EPL.txt b/src/test/java/com/googlesource/gerrit/plugins/copyright/testdata/licenses/EPL.txt
new file mode 100644
index 0000000..bc27987
--- /dev/null
+++ b/src/test/java/com/googlesource/gerrit/plugins/copyright/testdata/licenses/EPL.txt
@@ -0,0 +1,13 @@
+/*
+ * Licensed under the Eclipse Public License, Version 1.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.eclipse.org/org/documents/epl-v10.php
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
diff --git a/src/test/java/com/googlesource/gerrit/plugins/copyright/testdata/licenses/FTL.txt b/src/test/java/com/googlesource/gerrit/plugins/copyright/testdata/licenses/FTL.txt
new file mode 100644
index 0000000..d4d7ac4
--- /dev/null
+++ b/src/test/java/com/googlesource/gerrit/plugins/copyright/testdata/licenses/FTL.txt
@@ -0,0 +1,13 @@
+/***************************************************************************/
+/*                                                                         */
+/*  freetype.h                                                             */
+/*                                                                         */
+/*    FreeType high-level API and common types (specification only).       */
+/*                                                                         */
+/*  This file is part of the FreeType project, and may only be used,       */
+/*  modified, and distributed under the terms of the FreeType project      */
+/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */
+/*  this file you indicate that you have read the license and              */
+/*  understand and accept it fully.                                        */
+/*                                                                         */
+/***************************************************************************/
diff --git a/src/test/java/com/googlesource/gerrit/plugins/copyright/testdata/licenses/LIBTIFF.txt b/src/test/java/com/googlesource/gerrit/plugins/copyright/testdata/licenses/LIBTIFF.txt
new file mode 100644
index 0000000..e35d2ad
--- /dev/null
+++ b/src/test/java/com/googlesource/gerrit/plugins/copyright/testdata/licenses/LIBTIFF.txt
@@ -0,0 +1,20 @@
+/*
+ * Permission to use, copy, modify, distribute, and sell this software and
+ * its documentation for any purpose is hereby granted without fee, provided
+ * that (i) the above copyright notices and this permission notice appear in
+ * all copies of the software and related documentation, and (ii) the names of
+ * Sam Leffler and Silicon Graphics may not be used in any advertising or
+ * publicity relating to the software without the specific, prior written
+ * permission of Sam Leffler and Silicon Graphics.
+ *
+ * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
+ * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
+ *
+ * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR
+ * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
+ * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+ * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
+ * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
+ * OF THIS SOFTWARE.
+ */
diff --git a/src/test/java/com/googlesource/gerrit/plugins/copyright/testdata/licenses/LPL1_02.txt b/src/test/java/com/googlesource/gerrit/plugins/copyright/testdata/licenses/LPL1_02.txt
new file mode 100644
index 0000000..aca777c
--- /dev/null
+++ b/src/test/java/com/googlesource/gerrit/plugins/copyright/testdata/licenses/LPL1_02.txt
@@ -0,0 +1,3 @@
+This software is also made available under the Lucent Public License
+version 1.02; see http://plan9.bell-labs.com/plan9dist/license.html
+
diff --git a/src/test/java/com/googlesource/gerrit/plugins/copyright/testdata/licenses/NCSA.txt b/src/test/java/com/googlesource/gerrit/plugins/copyright/testdata/licenses/NCSA.txt
new file mode 100644
index 0000000..5524a9b
--- /dev/null
+++ b/src/test/java/com/googlesource/gerrit/plugins/copyright/testdata/licenses/NCSA.txt
@@ -0,0 +1,39 @@
+/**
+  University of Illinois/NCSA
+  Open Source License
+
+  Developed by:
+
+      LLVM Team
+
+      University of Illinois at Urbana-Champaign
+
+      http://llvm.org
+
+  Permission is hereby granted, free of charge, to any person obtaining a copy of
+  this software and associated documentation files (the "Software"), to deal with
+  the Software without restriction, including without limitation the rights to
+  use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
+  of the Software, and to permit persons to whom the Software is furnished to do
+  so, subject to the following conditions:
+
+      * Redistributions of source code must retain the above copyright notice,
+        this list of conditions and the following disclaimers.
+
+      * Redistributions in binary form must reproduce the above copyright notice,
+        this list of conditions and the following disclaimers in the
+        documentation and/or other materials provided with the distribution.
+
+      * Neither the names of the LLVM Team, University of Illinois at
+        Urbana-Champaign, nor the names of its contributors may be used to
+        endorse or promote products derived from this Software without specific
+        prior written permission.
+
+  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
+  FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
+  CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS WITH THE
+  SOFTWARE.
+**/
diff --git a/src/test/java/com/googlesource/gerrit/plugins/copyright/testdata/licenses/NOT_A_CONTRIBUTION.txt b/src/test/java/com/googlesource/gerrit/plugins/copyright/testdata/licenses/NOT_A_CONTRIBUTION.txt
new file mode 100644
index 0000000..32f02ff
--- /dev/null
+++ b/src/test/java/com/googlesource/gerrit/plugins/copyright/testdata/licenses/NOT_A_CONTRIBUTION.txt
@@ -0,0 +1,202 @@
+
+                                 Apache License
+                           Version 2.0, January 2004
+                        http://www.apache.org/licenses/
+Not a contribution.
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+   1. Definitions.
+
+      "License" shall mean the terms and conditions for use, reproduction,
+      and distribution as defined by Sections 1 through 9 of this document.
+
+      "Licensor" shall mean the copyright owner or entity authorized by
+      the copyright owner that is granting the License.
+
+      "Legal Entity" shall mean the union of the acting entity and all
+      other entities that control, are controlled by, or are under common
+      control with that entity. For the purposes of this definition,
+      "control" means (i) the power, direct or indirect, to cause the
+      direction or management of such entity, whether by contract or
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the
+      outstanding shares, or (iii) beneficial ownership of such entity.
+
+      "You" (or "Your") shall mean an individual or Legal Entity
+      exercising permissions granted by this License.
+
+      "Source" form shall mean the preferred form for making modifications,
+      including but not limited to software source code, documentation
+      source, and configuration files.
+
+      "Object" form shall mean any form resulting from mechanical
+      transformation or translation of a Source form, including but
+      not limited to compiled object code, generated documentation,
+      and conversions to other media types.
+
+      "Work" shall mean the work of authorship, whether in Source or
+      Object form, made available under the License, as indicated by a
+      copyright notice that is included in or attached to the work
+      (an example is provided in the Appendix below).
+
+      "Derivative Works" shall mean any work, whether in Source or Object
+      form, that is based on (or derived from) the Work and for which the
+      editorial revisions, annotations, elaborations, or other modifications
+      represent, as a whole, an original work of authorship. For the purposes
+      of this License, Derivative Works shall not include works that remain
+      separable from, or merely link (or bind by name) to the interfaces of,
+      the Work and Derivative Works thereof.
+
+      "Contribution" shall mean any work of authorship, including
+      the original version of the Work and any modifications or additions
+      to that Work or Derivative Works thereof, that is intentionally
+      submitted to Licensor for inclusion in the Work by the copyright owner
+      or by an individual or Legal Entity authorized to submit on behalf of
+      the copyright owner. For the purposes of this definition, "submitted"
+      means any form of electronic, verbal, or written communication sent
+      to the Licensor or its representatives, including but not limited to
+      communication on electronic mailing lists, source code control systems,
+      and issue tracking systems that are managed by, or on behalf of, the
+      Licensor for the purpose of discussing and improving the Work, but
+      excluding communication that is conspicuously marked or otherwise
+      designated in writing by the copyright owner as "Not a Contribution."
+
+      "Contributor" shall mean Licensor and any individual or Legal Entity
+      on behalf of whom a Contribution has been received by Licensor and
+      subsequently incorporated within the Work.
+
+   2. Grant of Copyright License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      copyright license to reproduce, prepare Derivative Works of,
+      publicly display, publicly perform, sublicense, and distribute the
+      Work and such Derivative Works in Source or Object form.
+
+   3. Grant of Patent License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      (except as stated in this section) patent license to make, have made,
+      use, offer to sell, sell, import, and otherwise transfer the Work,
+      where such license applies only to those patent claims licensable
+      by such Contributor that are necessarily infringed by their
+      Contribution(s) alone or by combination of their Contribution(s)
+      with the Work to which such Contribution(s) was submitted. If You
+      institute patent litigation against any entity (including a
+      cross-claim or counterclaim in a lawsuit) alleging that the Work
+      or a Contribution incorporated within the Work constitutes direct
+      or contributory patent infringement, then any patent licenses
+      granted to You under this License for that Work shall terminate
+      as of the date such litigation is filed.
+
+   4. Redistribution. You may reproduce and distribute copies of the
+      Work or Derivative Works thereof in any medium, with or without
+      modifications, and in Source or Object form, provided that You
+      meet the following conditions:
+
+      (a) You must give any other recipients of the Work or
+          Derivative Works a copy of this License; and
+
+      (b) You must cause any modified files to carry prominent notices
+          stating that You changed the files; and
+
+      (c) You must retain, in the Source form of any Derivative Works
+          that You distribute, all copyright, patent, trademark, and
+          attribution notices from the Source form of the Work,
+          excluding those notices that do not pertain to any part of
+          the Derivative Works; and
+
+      (d) If the Work includes a "NOTICE" text file as part of its
+          distribution, then any Derivative Works that You distribute must
+          include a readable copy of the attribution notices contained
+          within such NOTICE file, excluding those notices that do not
+          pertain to any part of the Derivative Works, in at least one
+          of the following places: within a NOTICE text file distributed
+          as part of the Derivative Works; within the Source form or
+          documentation, if provided along with the Derivative Works; or,
+          within a display generated by the Derivative Works, if and
+          wherever such third-party notices normally appear. The contents
+          of the NOTICE file are for informational purposes only and
+          do not modify the License. You may add Your own attribution
+          notices within Derivative Works that You distribute, alongside
+          or as an addendum to the NOTICE text from the Work, provided
+          that such additional attribution notices cannot be construed
+          as modifying the License.
+
+      You may add Your own copyright statement to Your modifications and
+      may provide additional or different license terms and conditions
+      for use, reproduction, or distribution of Your modifications, or
+      for any such Derivative Works as a whole, provided Your use,
+      reproduction, and distribution of the Work otherwise complies with
+      the conditions stated in this License.
+
+   5. Submission of Contributions. Unless You explicitly state otherwise,
+      any Contribution intentionally submitted for inclusion in the Work
+      by You to the Licensor shall be under the terms and conditions of
+      this License, without any additional terms or conditions.
+      Notwithstanding the above, nothing herein shall supersede or modify
+      the terms of any separate license agreement you may have executed
+      with Licensor regarding such Contributions.
+
+   6. Trademarks. This License does not grant permission to use the trade
+      names, trademarks, service marks, or product names of the Licensor,
+      except as required for reasonable and customary use in describing the
+      origin of the Work and reproducing the content of the NOTICE file.
+
+   7. Disclaimer of Warranty. Unless required by applicable law or
+      agreed to in writing, Licensor provides the Work (and each
+      Contributor provides its Contributions) on an "AS IS" BASIS,
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+      implied, including, without limitation, any warranties or conditions
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+      PARTICULAR PURPOSE. You are solely responsible for determining the
+      appropriateness of using or redistributing the Work and assume any
+      risks associated with Your exercise of permissions under this License.
+
+   8. Limitation of Liability. In no event and under no legal theory,
+      whether in tort (including negligence), contract, or otherwise,
+      unless required by applicable law (such as deliberate and grossly
+      negligent acts) or agreed to in writing, shall any Contributor be
+      liable to You for damages, including any direct, indirect, special,
+      incidental, or consequential damages of any character arising as a
+      result of this License or out of the use or inability to use the
+      Work (including but not limited to damages for loss of goodwill,
+      work stoppage, computer failure or malfunction, or any and all
+      other commercial damages or losses), even if such Contributor
+      has been advised of the possibility of such damages.
+
+   9. Accepting Warranty or Additional Liability. While redistributing
+      the Work or Derivative Works thereof, You may choose to offer,
+      and charge a fee for, acceptance of support, warranty, indemnity,
+      or other liability obligations and/or rights consistent with this
+      License. However, in accepting such obligations, You may act only
+      on Your own behalf and on Your sole responsibility, not on behalf
+      of any other Contributor, and only if You agree to indemnify,
+      defend, and hold each Contributor harmless for any liability
+      incurred by, or claims asserted against, such Contributor by reason
+      of your accepting any such warranty or additional liability.
+
+   END OF TERMS AND CONDITIONS
+
+   APPENDIX: How to apply the Apache License to your work.
+
+      To apply the Apache License to your work, attach the following
+      boilerplate notice, with the fields enclosed by brackets "[]"
+      replaced with your own identifying information. (Don't include
+      the brackets!)  The text should be enclosed in the appropriate
+      comment syntax for the file format. We also recommend that a
+      file or class name and description of purpose be included on the
+      same "printed page" as the copyright notice for easier
+      identification within third-party archives.
+
+   Copyright [yyyy] [name of copyright owner]
+
+   Licensed under the Apache License, Version 2.0 (the "License");
+   you may not use this file except in compliance with the License.
+   You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
diff --git a/src/test/java/com/googlesource/gerrit/plugins/copyright/testdata/licenses/OPENSSL.txt b/src/test/java/com/googlesource/gerrit/plugins/copyright/testdata/licenses/OPENSSL.txt
new file mode 100644
index 0000000..ee70df6
--- /dev/null
+++ b/src/test/java/com/googlesource/gerrit/plugins/copyright/testdata/licenses/OPENSSL.txt
@@ -0,0 +1,107 @@
+# Copyright (c) 1998-2011 The OpenSSL Project.  All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+#
+# 1. Redistributions of source code must retain the above copyright
+#    notice, this list of conditions and the following disclaimer.
+#
+# 2. Redistributions in binary form must reproduce the above copyright
+#    notice, this list of conditions and the following disclaimer in
+#    the documentation and/or other materials provided with the
+#    distribution.
+#
+# 3. All advertising materials mentioning features or use of this
+#    software must display the following acknowledgment:
+#    "This product includes software developed by the OpenSSL Project
+#    for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
+#
+# 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
+#    endorse or promote products derived from this software without
+#    prior written permission. For written permission, please contact
+#    openssl-core@openssl.org.
+#
+# 5. Products derived from this software may not be called "OpenSSL"
+#    nor may "OpenSSL" appear in their names without prior written
+#    permission of the OpenSSL Project.
+#
+# 6. Redistributions of any form whatsoever must retain the following
+#    acknowledgment:
+#    "This product includes software developed by the OpenSSL Project
+#    for use in the OpenSSL Toolkit (http://www.openssl.org/)"
+#
+# THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
+# EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+# PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE OpenSSL PROJECT OR
+# ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+# OF THE POSSIBILITY OF SUCH DAMAGE.
+# ====================================================================
+
+# Original SSLeay License
+# -----------------------
+
+# Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
+# All rights reserved.
+#
+# This package is an SSL implementation written
+# by Eric Young (eay@cryptsoft.com).
+# The implementation was written so as to conform with Netscapes SSL.
+#
+# This library is free for commercial and non-commercial use as long as
+# the following conditions are aheared to.  The following conditions
+# apply to all code found in this distribution, be it the RC4, RSA,
+# lhash, DES, etc., code; not just the SSL code.  The SSL documentation
+# included with this distribution is covered by the same copyright terms
+# except that the holder is Tim Hudson (tjh@cryptsoft.com).
+#
+# Copyright remains Eric Young's, and as such any Copyright notices in
+# the code are not to be removed.
+# If this package is used in a product, Eric Young should be given attribution
+# as the author of the parts of the library used.
+# This can be in the form of a textual message at program startup or
+# in documentation (online or textual) provided with the package.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the copyright
+#    notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+#    notice, this list of conditions and the following disclaimer in the
+#    documentation and/or other materials provided with the distribution.
+# 3. All advertising materials mentioning features or use of this software
+#    must display the following acknowledgement:
+#    "This product includes cryptographic software written by
+#     Eric Young (eay@cryptsoft.com)"
+#    The word 'cryptographic' can be left out if the rouines from the library
+#    being used are not cryptographic related :-).
+# 4. If you include any Windows specific code (or a derivative thereof) from
+#    the apps directory (application code) you must include an acknowledgement:
+#    "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
+#
+# THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+# SUCH DAMAGE.
+#
+# The licence and distribution terms for any publically available version or
+# derivative of this code cannot be changed.  i.e. this code cannot simply be
+# copied and put under another distribution licence
+# [including the GNU Public Licence.]
+#
+
diff --git a/src/test/java/com/googlesource/gerrit/plugins/copyright/testdata/licenses/PSFL.txt b/src/test/java/com/googlesource/gerrit/plugins/copyright/testdata/licenses/PSFL.txt
new file mode 100644
index 0000000..45aecdb
--- /dev/null
+++ b/src/test/java/com/googlesource/gerrit/plugins/copyright/testdata/licenses/PSFL.txt
@@ -0,0 +1,50 @@
+PYTHON SOFTWARE FOUNDATION LICENSE VERSION 2
+--------------------------------------------
+
+1. This LICENSE AGREEMENT is between the Python Software Foundation
+("PSF"), and the Individual or Organization ("Licensee") accessing and
+otherwise using this software ("Python") in source or binary form and
+its associated documentation.
+
+2. Subject to the terms and conditions of this License Agreement, PSF hereby
+grants Licensee a nonexclusive, royalty-free, world-wide license to reproduce,
+analyze, test, perform and/or display publicly, prepare derivative works,
+distribute, and otherwise use Python alone or in any derivative version,
+provided, however, that PSF's License Agreement and PSF's notice of copyright,
+i.e., "Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
+2011, 2012, 2013, 2014, 2015, 2016 Python Software Foundation; All Rights
+Reserved" are retained in Python alone or in any derivative version prepared by
+Licensee.
+
+3. In the event Licensee prepares a derivative work that is based on
+or incorporates Python or any part thereof, and wants to make
+the derivative work available to others as provided herein, then
+Licensee hereby agrees to include in any such work a brief summary of
+the changes made to Python.
+
+4. PSF is making Python available to Licensee on an "AS IS"
+basis.  PSF MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR
+IMPLIED.  BY WAY OF EXAMPLE, BUT NOT LIMITATION, PSF MAKES NO AND
+DISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS
+FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF PYTHON WILL NOT
+INFRINGE ANY THIRD PARTY RIGHTS.
+
+5. PSF SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF PYTHON
+FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS AS
+A RESULT OF MODIFYING, DISTRIBUTING, OR OTHERWISE USING PYTHON,
+OR ANY DERIVATIVE THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF.
+
+6. This License Agreement will automatically terminate upon a material
+breach of its terms and conditions.
+
+7. Nothing in this License Agreement shall be deemed to create any
+relationship of agency, partnership, or joint venture between PSF and
+Licensee.  This License Agreement does not grant permission to use PSF
+trademarks or trade name in a trademark sense to endorse or promote
+products or services of Licensee, or any third party.
+
+8. By copying, installing or otherwise using Python, Licensee
+agrees to be bound by the terms and conditions of this License
+Agreement.
+
+
diff --git a/src/test/java/com/googlesource/gerrit/plugins/copyright/testdata/licenses/SSPL.txt b/src/test/java/com/googlesource/gerrit/plugins/copyright/testdata/licenses/SSPL.txt
new file mode 100644
index 0000000..a73ed78
--- /dev/null
+++ b/src/test/java/com/googlesource/gerrit/plugins/copyright/testdata/licenses/SSPL.txt
@@ -0,0 +1,497 @@
+Server Side Public License
+
+VERSION 1, OCTOBER 16, 2018
+
+Copyright © 2018 MongoDB, Inc.
+
+Everyone is permitted to copy and distribute verbatim copies of this license
+document, but changing it is not allowed.
+
+TERMS AND CONDITIONS
+0. Definitions.
+
+“This License” refers to Server Side Public License.
+
+“Copyright” also means copyright-like laws that apply to other kinds of works,
+such as semiconductor masks.
+
+“The Program” refers to any copyrightable work licensed under this License. Each
+licensee is addressed as “you”. “Licensees” and “recipients” may be individuals
+or organizations.
+
+To “modify” a work means to copy from or adapt all or part of the work in a
+fashion requiring copyright permission, other than the making of an exact copy.
+The resulting work is called a “modified version” of the earlier work or a work
+“based on” the earlier work.
+
+A “covered work” means either the unmodified Program or a work based on the
+Program.
+
+To “propagate” a work means to do anything with it that, without permission,
+would make you directly or secondarily liable for infringement under applicable
+copyright law, except executing it on a computer or modifying a private copy.
+Propagation includes copying, distribution (with or without modification),
+making available to the public, and in some countries other activities as well.
+
+To “convey” a work means any kind of propagation that enables other parties to
+make or receive copies. Mere interaction with a user through a computer network,
+with no transfer of a copy, is not conveying.
+
+An interactive user interface displays “Appropriate Legal Notices” to the extent
+that it includes a convenient and prominently visible feature that (1) displays
+an appropriate copyright notice, and (2) tells the user that there is no
+warranty for the work (except to the extent that warranties are provided), that
+licensees may convey the work under this License, and how to view a copy of this
+License. If the interface presents a list of user commands or options, such as a
+menu, a prominent item in the list meets this criterion.
+
+1. Source Code.
+
+The “source code” for a work means the preferred form of the work for making
+modifications to it. “Object code” means any non-source form of a work.
+
+A “Standard Interface” means an interface that either is an official standard
+defined by a recognized standards body, or, in the case of interfaces specified
+for a particular programming language, one that is widely used among developers
+working in that language.
+
+The “System Libraries” of an executable work include anything, other than the
+work as a whole, that (a) is included in the normal form of packaging a Major
+Component, but which is not part of that Major Component, and (b) serves only to
+enable use of the work with that Major Component, or to implement a Standard
+Interface for which an implementation is available to the public in source code
+form. A “Major Component”, in this context, means a major essential component
+(kernel, window system, and so on) of the specific operating system (if any) on
+which the executable work runs, or a compiler used to produce the work, or an
+object code interpreter used to run it.
+
+The “Corresponding Source” for a work in object code form means all the source
+code needed to generate, install, and (for an executable work) run the object
+code and to modify the work, including scripts to control those activities.
+However, it does not include the work's System Libraries, or general-purpose
+tools or generally available free programs which are used unmodified in
+performing those activities but which are not part of the work. For example,
+Corresponding Source includes interface definition files associated with source
+files for the work, and the source code for shared libraries and dynamically
+linked subprograms that the work is specifically designed to require, such as by
+intimate data communication or control flow between those subprograms and other
+parts of the work.
+
+The Corresponding Source need not include anything that users can regenerate
+automatically from other parts of the Corresponding Source.
+
+The Corresponding Source for a work in source code form is that same work.
+
+2. Basic Permissions.
+
+All rights granted under this License are granted for the term of copyright on
+the Program, and are irrevocable provided the stated conditions are met. This
+License explicitly affirms your unlimited permission to run the unmodified
+Program, subject to section 13. The output from running a covered work is
+covered by this License only if the output, given its content, constitutes a
+covered work. This License acknowledges your rights of fair use or other
+equivalent, as provided by copyright law.
+
+Subject to section 13, you may make, run and propagate covered works that you do
+not convey, without conditions so long as your license otherwise remains in
+force. You may convey covered works to others for the sole purpose of having
+them make modifications exclusively for you, or provide you with facilities for
+running those works, provided that you comply with the terms of this License in
+conveying all material for which you do not control copyright. Those thus making
+or running the covered works for you must do so exclusively on your behalf,
+under your direction and control, on terms that prohibit them from making any
+copies of your copyrighted material outside their relationship with you.
+
+Conveying under any other circumstances is permitted solely under the conditions
+stated below. Sublicensing is not allowed; section 10 makes it unnecessary.
+
+3. Protecting Users' Legal Rights From Anti-Circumvention Law.
+
+No covered work shall be deemed part of an effective technological measure under
+any applicable law fulfilling obligations under article 11 of the WIPO copyright
+treaty adopted on 20 December 1996, or similar laws prohibiting or restricting
+circumvention of such measures.
+
+When you convey a covered work, you waive any legal power to forbid
+circumvention of technological measures to the extent such circumvention is
+effected by exercising rights under this License with respect to the covered
+work, and you disclaim any intention to limit operation or modification of the
+work as a means of enforcing, against the work's users, your or third parties'
+legal rights to forbid circumvention of technological measures.
+
+4. Conveying Verbatim Copies.
+
+You may convey verbatim copies of the Program's source code as you receive it,
+in any medium, provided that you conspicuously and appropriately publish on each
+copy an appropriate copyright notice; keep intact all notices stating that this
+License and any non-permissive terms added in accord with section 7 apply to the
+code; keep intact all notices of the absence of any warranty; and give all
+recipients a copy of this License along with the Program.
+
+You may charge any price or no price for each copy that you convey, and you may
+offer support or warranty protection for a fee.
+
+5. Conveying Modified Source Versions.
+
+You may convey a work based on the Program, or the modifications to produce it
+from the Program, in the form of source code under the terms of section 4,
+provided that you also meet all of these conditions:
+
+    a) The work must carry prominent notices stating that you modified it, and
+    giving a relevant date.
+    b) The work must carry prominent notices stating that it is released under
+    this License and any conditions added under section 7. This requirement
+    modifies the requirement in section 4 to “keep intact all notices”.
+    c) You must license the entire work, as a whole, under this License to
+    anyone who comes into possession of a copy. This License will therefore
+    apply, along with any applicable section 7 additional terms, to the whole of
+    the work, and all its parts, regardless of how they are packaged. This
+    License gives no permission to license the work in any other way, but it
+    does not invalidate such permission if you have separately received it.
+    d) If the work has interactive user interfaces, each must display
+    Appropriate Legal Notices; however, if the Program has interactive
+    interfaces that do not display Appropriate Legal Notices, your work need not
+    make them do so.
+
+A compilation of a covered work with other separate and independent works, which
+are not by their nature extensions of the covered work, and which are not
+combined with it such as to form a larger program, in or on a volume of a
+storage or distribution medium, is called an “aggregate” if the compilation and
+its resulting copyright are not used to limit the access or legal rights of the
+compilation's users beyond what the individual works permit. Inclusion of a
+covered work in an aggregate does not cause this License to apply to the other
+parts of the aggregate.
+
+6. Conveying Non-Source Forms.
+
+You may convey a covered work in object code form under the terms of sections 4
+and 5, provided that you also convey the machine-readable Corresponding Source
+under the terms of this License, in one of these ways:
+
+    a) Convey the object code in, or embodied in, a physical product (including
+    a physical distribution medium), accompanied by the Corresponding Source
+    fixed on a durable physical medium customarily used for software
+    interchange.
+    b) Convey the object code in, or embodied in, a physical product (including
+    a physical distribution medium), accompanied by a written offer, valid for
+    at least three years and valid for as long as you offer spare parts or
+    customer support for that product model, to give anyone who possesses the
+    object code either (1) a copy of the Corresponding Source for all the
+    software in the product that is covered by this License, on a durable
+    physical medium customarily used for software interchange, for a price no
+    more than your reasonable cost of physically performing this conveying of
+    source, or (2) access to copy the Corresponding Source from a network server
+    at no charge.
+    c) Convey individual copies of the object code with a copy of the written
+    offer to provide the Corresponding Source. This alternative is allowed only
+    occasionally and noncommercially, and only if you received the object code
+    with such an offer, in accord with subsection 6b.
+    d) Convey the object code by offering access from a designated place (gratis
+    or for a charge), and offer equivalent access to the Corresponding Source in
+    the same way through the same place at no further charge. You need not
+    require recipients to copy the Corresponding Source along with the object
+    code. If the place to copy the object code is a network server, the
+    Corresponding Source may be on a different server (operated by you or a
+    third party) that supports equivalent copying facilities, provided you
+    maintain clear directions next to the object code saying where to find the
+    Corresponding Source. Regardless of what server hosts the Corresponding
+    Source, you remain obligated to ensure that it is available for as long as
+    needed to satisfy these requirements.
+    e) Convey the object code using peer-to-peer transmission, provided you
+    inform other peers where the object code and Corresponding Source of the
+    work are being offered to the general public at no charge under subsection
+    6d.
+
+A separable portion of the object code, whose source code is excluded from the
+Corresponding Source as a System Library, need not be included in conveying the
+object code work.
+
+A “User Product” is either (1) a “consumer product”, which means any tangible
+personal property which is normally used for personal, family, or household
+purposes, or (2) anything designed or sold for incorporation into a dwelling.
+In determining whether a product is a consumer product, doubtful cases shall be
+resolved in favor of coverage. For a particular product received by a particular
+user, “normally used” refers to a typical or common use of that class of
+product, regardless of the status of the particular user or of the way in which
+the particular user actually uses, or expects or is expected to use, the
+product. A product is a consumer product regardless of whether the product has
+substantial commercial, industrial or non-consumer uses, unless such uses
+represent the only significant mode of use of the product.
+
+“Installation Information” for a User Product means any methods, procedures,
+authorization keys, or other information required to install and execute
+modified versions of a covered work in that User Product from a modified version
+of its Corresponding Source. The information must suffice to ensure that the
+continued functioning of the modified object code is in no case prevented or
+interfered with solely because modification has been made.
+
+If you convey an object code work under this section in, or with, or
+specifically for use in, a User Product, and the conveying occurs as part of a
+transaction in which the right of possession and use of the User Product is
+transferred to the recipient in perpetuity or for a fixed term (regardless of
+how the transaction is characterized), the Corresponding Source conveyed under
+this section must be accompanied by the Installation Information. But this
+requirement does not apply if neither you nor any third party retains the
+ability to install modified object code on the User Product (for example, the
+work has been installed in ROM).
+
+The requirement to provide Installation Information does not include a
+requirement to continue to provide support service, warranty, or updates for a
+work that has been modified or installed by the recipient, or for the User
+Product in which it has been modified or installed. Access to a network may be
+denied when the modification itself materially and adversely affects the
+operation of the network or violates the rules and protocols for communication
+across the network.
+
+Corresponding Source conveyed, and Installation Information provided, in accord
+with this section must be in a format that is publicly documented (and with an
+implementation available to the public in source code form), and must require no
+special password or key for unpacking, reading or copying.
+7. Additional Terms.
+
+Notwithstanding any other provision of this License, for material you add to a
+covered work, you may (if authorized by the copyright holders of that material)
+supplement the terms of this License with terms:
+
+    a) Disclaiming warranty or limiting liability differently from the terms of
+    sections 15 and 16 of this License; or
+    b) Requiring preservation of specified reasonable legal notices or author
+    attributions in that material or in the Appropriate Legal Notices displayed
+    by works containing it; or
+    c) Prohibiting misrepresentation of the origin of that material, or
+    requiring that modified versions of such material be marked in reasonable
+    ways as different from the original version; or
+    d) Limiting the use for publicity purposes of names of licensors or authors
+    of the material; or
+    e) Declining to grant rights under trademark law for use of some trade
+    names, trademarks, or service marks; or
+    f) Requiring indemnification of licensors and authors of that material by
+    anyone who conveys the material (or modified versions of it) with
+    contractual assumptions of liability to the recipient, for any liability
+    that these contractual assumptions directly impose on those licensors and
+    authors.
+
+All other non-permissive additional terms are considered “further restrictions”
+within the meaning of section 10. If the Program as you received it, or any part
+of it, contains a notice stating that it is governed by this License along with
+a term that is a further restriction, you may remove that term. If a license
+document contains a further restriction but permits relicensing or conveying
+under this License, you may add to a covered work material governed by the terms
+of that license document, provided that the further restriction does not survive
+such relicensing or conveying.
+
+If you add terms to a covered work in accord with this section, you must place,
+in the relevant source files, a statement of the additional terms that apply to
+those files, or a notice indicating where to find the applicable terms.
+
+Additional terms, permissive or non-permissive, may be stated in the form of a
+separately written license, or stated as exceptions; the above requirements
+apply either way.
+
+8. Termination.
+
+You may not propagate or modify a covered work except as expressly provided
+under this License. Any attempt otherwise to propagate or modify it is void, and
+will automatically terminate your rights under this License (including any
+patent licenses granted under the third paragraph of section 11).
+
+However, if you cease all violation of this License, then your license from a
+particular copyright holder is reinstated (a) provisionally, unless and until
+the copyright holder explicitly and finally terminates your license, and (b)
+permanently, if the copyright holder fails to notify you of the violation by
+some reasonable means prior to 60 days after the cessation.
+
+Moreover, your license from a particular copyright holder is reinstated
+permanently if the copyright holder notifies you of the violation by some
+reasonable means, this is the first time you have received notice of violation
+of this License (for any work) from that copyright holder, and you cure the
+violation prior to 30 days after your receipt of the notice.
+
+Termination of your rights under this section does not terminate the licenses of
+parties who have received copies or rights from you under this License. If your
+rights have been terminated and not permanently reinstated, you do not qualify
+to receive new licenses for the same material under section 10.
+
+9. Acceptance Not Required for Having Copies.
+
+You are not required to accept this License in order to receive or run a copy of
+the Program. Ancillary propagation of a covered work occurring solely as a
+consequence of using peer-to-peer transmission to receive a copy likewise does
+not require acceptance. However, nothing other than this License grants you
+permission to propagate or modify any covered work. These actions infringe
+copyright if you do not accept this License. Therefore, by modifying or
+propagating a covered work, you indicate your acceptance of this License to do
+so.
+
+10. Automatic Licensing of Downstream Recipients.
+
+Each time you convey a covered work, the recipient automatically receives a
+license from the original licensors, to run, modify and propagate that work,
+subject to this License. You are not responsible for enforcing compliance by
+third parties with this License.
+
+An “entity transaction” is a transaction transferring control of an
+organization, or substantially all assets of one, or subdividing an
+organization, or merging organizations. If propagation of a covered work results
+from an entity transaction, each party to that transaction who receives a copy
+of the work also receives whatever licenses to the work the party's predecessor
+in interest had or could give under the previous paragraph, plus a right to
+possession of the Corresponding Source of the work from the predecessor in
+interest, if the predecessor has it or can get it with reasonable efforts.
+
+You may not impose any further restrictions on the exercise of the rights
+granted or affirmed under this License. For example, you may not impose a
+license fee, royalty, or other charge for exercise of rights granted under this
+License, and you may not initiate litigation (including a cross-claim or
+counterclaim in a lawsuit) alleging that any patent claim is infringed by
+making, using, selling, offering for sale, or importing the Program or any
+portion of it.
+
+11. Patents.
+
+A “contributor” is a copyright holder who authorizes use under this License of
+the Program or a work on which the Program is based. The work thus licensed is
+called the contributor's “contributor version”.
+
+A contributor's “essential patent claims” are all patent claims owned or
+controlled by the contributor, whether already acquired or hereafter acquired,
+that would be infringed by some manner, permitted by this License, of making,
+using, or selling its contributor version, but do not include claims that would
+be infringed only as a consequence of further modification of the contributor
+version. For purposes of this definition, “control” includes the right to grant
+patent sublicenses in a manner consistent with the requirements of this License.
+
+Each contributor grants you a non-exclusive, worldwide, royalty-free patent
+license under the contributor's essential patent claims, to make, use, sell,
+offer for sale, import and otherwise run, modify and propagate the contents of
+its contributor version.
+
+In the following three paragraphs, a “patent license” is any express agreement
+or commitment, however denominated, not to enforce a patent (such as an express
+permission to practice a patent or covenant not to sue for patent infringement).
+To “grant” such a patent license to a party means to make such an agreement or
+commitment not to enforce a patent against the party.
+
+If you convey a covered work, knowingly relying on a patent license, and the
+Corresponding Source of the work is not available for anyone to copy, free of
+charge and under the terms of this License, through a publicly available network
+server or other readily accessible means, then you must either (1) cause the
+Corresponding Source to be so available, or (2) arrange to deprive yourself of
+the benefit of the patent license for this particular work, or (3) arrange, in a
+manner consistent with the requirements of this License, to extend the patent
+license to downstream recipients. “Knowingly relying” means you have actual
+knowledge that, but for the patent license, your conveying the covered work in a
+country, or your recipient's use of the covered work in a country, would
+infringe one or more identifiable patents in that country that you have reason
+to believe are valid.
+
+If, pursuant to or in connection with a single transaction or arrangement, you
+convey, or propagate by procuring conveyance of, a covered work, and grant a
+patent license to some of the parties receiving the covered work authorizing
+them to use, propagate, modify or convey a specific copy of the covered work,
+then the patent license you grant is automatically extended to all recipients of
+the covered work and works based on it.
+
+A patent license is “discriminatory” if it does not include within the scope of
+its coverage, prohibits the exercise of, or is conditioned on the non-exercise
+of one or more of the rights that are specifically granted under this License.
+You may not convey a covered work if you are a party to an arrangement with a
+third party that is in the business of distributing software, under which you
+make payment to the third party based on the extent of your activity of
+conveying the work, and under which the third party grants, to any of the
+parties who would receive the covered work from you, a discriminatory patent
+license (a) in connection with copies of the covered work conveyed by you (or
+copies made from those copies), or (b) primarily for and in connection with
+specific products or compilations that contain the covered work, unless you
+entered into that arrangement, or that patent license was granted, prior to 28
+March 2007.
+
+Nothing in this License shall be construed as excluding or limiting any implied
+license or other defenses to infringement that may otherwise be available to you
+under applicable patent law.
+
+12. No Surrender of Others' Freedom.
+
+If conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not excuse
+you from the conditions of this License. If you cannot use, propagate or convey
+a covered work so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you may not
+use, propagate or convey it at all. For example, if you agree to terms that
+obligate you to collect a royalty for further conveying from those to whom you
+convey the Program, the only way you could satisfy both those terms and this
+License would be to refrain entirely from conveying the Program.
+
+13. Offering the Program as a Service.
+
+If you make the functionality of the Program or a modified version available to
+third parties as a service, you must make the Service Source Code available via
+network download to everyone at no charge, under the terms of this License.
+Making the functionality of the Program or modified version available to third
+parties as a service includes, without limitation, enabling third parties to
+interact with the functionality of the Program or modified version remotely
+through a computer network, offering a service the value of which entirely or
+primarily derives from the value of the Program or modified version, or offering
+a service that accomplishes for users the primary purpose of the Program or
+modified version.
+
+“Service Source Code” means the Corresponding Source for the Program or the
+modified version, and the Corresponding Source for all programs that you use to
+make the Program or modified version available as a service, including, without
+limitation, management software, user interfaces, application program
+interfaces, automation software, monitoring software, backup software, storage
+software and hosting software, all such that a user could run an instance of the
+service using the Service Source Code you make available.
+
+14. Revised Versions of this License.
+
+MongoDB, Inc. may publish revised and/or new versions of the Server Side Public
+License from time to time. Such new versions will be similar in spirit to the
+present version, but may differ in detail to address new problems or concerns.
+
+Each version is given a distinguishing version number. If the Program specifies
+that a certain numbered version of the Server Side Public License “or any later
+version” applies to it, you have the option of following the terms and
+conditions either of that numbered version or of any later version published by
+MongoDB, Inc. If the Program does not specify a version number of the Server
+Side Public License, you may choose any version ever published by MongoDB, Inc.
+
+If the Program specifies that a proxy can decide which future versions of the
+Server Side Public License can be used, that proxy's public statement of
+acceptance of a version permanently authorizes you to choose that version for
+the Program.
+
+Later license versions may give you additional or different permissions.
+However, no additional obligations are imposed on any author or copyright holder
+as a result of your choosing to follow a later version.
+
+15. Disclaimer of Warranty.
+
+THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
+EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER
+PARTIES PROVIDE THE PROGRAM “AS IS” WITHOUT WARRANTY OF ANY KIND, EITHER
+EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE
+QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE
+DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+16. Limitation of Liability.
+
+IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY
+COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM AS
+PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL,
+INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE
+THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED
+INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE
+PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY
+HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+
+17. Interpretation of Sections 15 and 16.
+
+If the disclaimer of warranty and limitation of liability provided above cannot
+be given local legal effect according to their terms, reviewing courts shall
+apply local law that most closely approximates an absolute waiver of all civil
+liability in connection with the Program, unless a warranty or assumption of
+liability accompanies a copy of the Program in return for a fee.
+
+END OF TERMS AND CONDITIONS
diff --git a/src/test/java/com/googlesource/gerrit/plugins/copyright/testdata/licenses/UNICODE.txt b/src/test/java/com/googlesource/gerrit/plugins/copyright/testdata/licenses/UNICODE.txt
new file mode 100644
index 0000000..ce64bb2
--- /dev/null
+++ b/src/test/java/com/googlesource/gerrit/plugins/copyright/testdata/licenses/UNICODE.txt
@@ -0,0 +1,173 @@
+Unicode Terms of Use
+
+For the general privacy policy governing access to this site, see the Unicode
+Privacy Policy. For trademark usage, see the Unicode<C2><AE> Consortium Name and
+Trademark Usage Policy.
+
+A. Unicode Copyright.
+   1. Copyright <C2><A9> 1991-2013 Unicode, Inc. All rights reserved.
+
+   2. Certain documents and files on this website contain a legend indicating
+      that "Modification is permitted." Any person is hereby authorized,
+      without fee, to modify such documents and files to create derivative
+      works conforming to the Unicode<C2><AE> Standard, subject to Terms and
+      Conditions herein.
+
+    3. Any person is hereby authorized, without fee, to view, use, reproduce,
+       and distribute all documents and files solely for informational
+       purposes in the creation of products supporting the Unicode Standard,
+       subject to the Terms and Conditions herein.
+
+    4. Further specifications of rights and restrictions pertaining to the use
+       of the particular set of data files known as the "Unicode Character
+       Database" can be found in Exhibit 1.
+
+    5. Each version of the Unicode Standard has further specifications of
+       rights and restrictions of use. For the book editions (Unicode 5.0 and
+       earlier), these are found on the back of the title page. The online
+       code charts carry specific restrictions. All other files, including
+       online documentation of the core specification for Unicode 6.0 and
+       later, are covered under these general Terms of Use.
+
+    6. No license is granted to "mirror" the Unicode website where a fee is
+       charged for access to the "mirror" site.
+
+    7. Modification is not permitted with respect to this document. All copies
+       of this document must be verbatim.
+
+B. Restricted Rights Legend. Any technical data or software which is licensed
+   to the United States of America, its agencies and/or instrumentalities
+   under this Agreement is commercial technical data or commercial computer
+   software developed exclusively at private expense as defined in FAR 2.101,
+   or DFARS 252.227-7014 (June 1995), as applicable. For technical data, use,
+   duplication, or disclosure by the Government is subject to restrictions as
+   set forth in DFARS 202.227-7015 Technical Data, Commercial and Items (Nov
+   1995) and this Agreement. For Software, in accordance with FAR 12-212 or
+   DFARS 227-7202, as applicable, use, duplication or disclosure by the
+   Government is subject to the restrictions set forth in this Agreement.
+
+C. Warranties and Disclaimers.
+   1. This publication and/or website may include technical or typographical
+      errors or other inaccuracies . Changes are periodically added to the
+      information herein; these changes will be incorporated in new editions
+      of the publication and/or website. Unicode may make improvements and/or
+      changes in the product(s) and/or program(s) described in this
+      publication and/or website at any time.
+
+    2. If this file has been purchased on magnetic or optical media from
+       Unicode, Inc. the sole and exclusive remedy for any claim will be
+       exchange of the defective media within ninety (90) days of original
+       purchase.
+
+    3. EXCEPT AS PROVIDED IN SECTION C.2, THIS PUBLICATION AND/OR SOFTWARE IS
+       PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND EITHER EXPRESS, IMPLIED,
+       OR STATUTORY, INCLUDING, BUT NOT LIMITED TO, ANY WARRANTIES OF
+       MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT.
+       UNICODE AND ITS LICENSORS ASSUME NO RESPONSIBILITY FOR ERRORS OR
+       OMISSIONS IN THIS PUBLICATION AND/OR SOFTWARE OR OTHER DOCUMENTS WHICH
+       ARE REFERENCED BY OR LINKED TO THIS PUBLICATION OR THE UNICODE WEBSITE.
+
+D. Waiver of Damages. In no event shall Unicode or its licensors be liable for
+   any special, incidental, indirect or consequential damages of any kind, or
+   any damages whatsoever, whether or not Unicode was advised of the
+   possibility of the damage, including, without limitation, those resulting
+   from the following: loss of use, data or profits, in connection with the
+   use, modification or distribution of this information or its derivatives.
+
+E.Trademarks & Logos.
+   1. The Unicode Word Mark and the Unicode Logo are trademarks of Unicode,
+      Inc.  <E2><80><9C>The Unicode Consortium<E2><80><9D> and <E2><80><9C>Unicode, Inc.<E2><80><9D> are trade names of
+      Unicode, Inc.  Use of the information and materials found on this
+      website indicates your acknowledgement of Unicode, Inc.<E2><80><99>s exclusive
+      worldwide rights in the Unicode Word Mark, the Unicode Logo, and the
+      Unicode trade names.
+
+   2. The Unicode Consortium Name and Trademark Usage Policy (<E2><80><9C>Trademark
+      Policy<E2><80><9D>) are incorporated herein by reference and you agree to abide by
+      the provisions of the Trademark Policy, which may be changed from time
+      to time in the sole discretion of Unicode, Inc.
+
+   3. All third party trademarks referenced herein are the property of their
+      respective owners.
+
+Miscellaneous.
+   1. Jurisdiction and Venue. This server is operated from a location in the
+      State of California, United States of America. Unicode makes no
+      representation that the materials are appropriate for use in other
+      locations. If you access this server from other locations, you are
+      responsible for compliance with local laws. This Agreement, all use of
+      this site and any claims and damages resulting from use of this site are
+      governed solely by the laws of the State of California without regard to
+      any principles which would apply the laws of a different jurisdiction.
+      The user agrees that any disputes regarding this site shall be resolved
+      solely in the courts located in Santa Clara County, California. The user
+      agrees said courts have personal jurisdiction and agree to waive any
+      right to transfer the dispute to any other forum.
+
+   2. Modification by Unicode.  Unicode shall have the right to modify this
+      Agreement at any time by posting it to this site. The user may not
+      assign any part of this Agreement without Unicode<E2><80><99>s prior written
+      consent.
+
+   3. Taxes. The user agrees to pay any taxes arising from access to this
+      website or use of the information herein, except for those based on
+      Unicode<E2><80><99>s net income.
+
+   4. Severability.  If any provision of this Agreement is declared invalid or
+      unenforceable, the remaining provisions of this Agreement shall remain
+      in effect.
+
+   5. Entire Agreement. This Agreement constitutes the entire agreement
+      between the parties.
+
+EXHIBIT 1
+
+UNICODE, INC. LICENSE AGREEMENT - DATA FILES AND SOFTWARE
+
+Unicode Data Files include all data files under the directories
+http://www.unicode.org/Public/, http://www.unicode.org/reports/,
+and http://www.unicode.org/cldr/data/ . Unicode Software includes any
+source code published in the Unicode Standard or under the directories
+http://www.unicode.org/Public/, http://www.unicode.org/reports/, and
+http://www.unicode.org/cldr/data/.
+
+NOTICE TO USER: Carefully read the following legal agreement. BY
+DOWNLOADING, INSTALLING, COPYING OR OTHERWISE USING UNICODE INC.'S DATA
+FILES ("DATA FILES"), AND/OR SOFTWARE ("SOFTWARE"), YOU UNEQUIVOCALLY
+ACCEPT, AND AGREE TO BE BOUND BY, ALL OF THE TERMS AND CONDITIONS OF
+THIS AGREEMENT. IF YOU DO NOT AGREE, DO NOT DOWNLOAD, INSTALL, COPY,
+DISTRIBUTE OR USE THE DATA FILES OR SOFTWARE.
+
+COPYRIGHT AND PERMISSION NOTICE
+
+Copyright <C2><A9> 1991-2008 Unicode, Inc. All rights reserved. Distributed
+under the Terms of Use in http://www.unicode.org/copyright.html.
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of the Unicode data files and any associated documentation (the
+"Data Files") or Unicode software and any associated documentation (the
+"Software") to deal in the Data Files or Software without restriction,
+including without limitation the rights to use, copy, modify, merge,
+publish, distribute, and/or sell copies of the Data Files or Software,
+and to permit persons to whom the Data Files or Software are furnished to
+do so, provided that (a) the above copyright notice(s) and this permission
+notice appear with all copies of the Data Files or Software, (b) both the
+above copyright notice(s) and this permission notice appear in associated
+documentation, and (c) there is clear notice in each modified Data File
+or in the Software as well as in the documentation associated with the
+Data File(s) or Software that the data or software has been modified.
+
+THE DATA FILES AND SOFTWARE ARE PROVIDED "AS IS", WITHOUT WARRANTY OF
+ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
+OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS
+INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT
+OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
+OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE
+OR PERFORMANCE OF THE DATA FILES OR SOFTWARE.
+
+Except as contained in this notice, the name of a copyright holder
+shall not be used in advertising or otherwise to promote the sale, use
+or other dealings in these Data Files or Software without prior written
+authorization of the copyright holder.
diff --git a/src/test/java/com/googlesource/gerrit/plugins/copyright/testdata/licenses/UNLICENSE.txt b/src/test/java/com/googlesource/gerrit/plugins/copyright/testdata/licenses/UNLICENSE.txt
new file mode 100644
index 0000000..9f759ab
--- /dev/null
+++ b/src/test/java/com/googlesource/gerrit/plugins/copyright/testdata/licenses/UNLICENSE.txt
@@ -0,0 +1,16 @@
+This is free and unencumbered software released into the public domain.
+Anyone is free to copy, modify, publish, use, compile, sell, or distribute this
+software, either in source code form or as a compiled binary, for any purpose,
+commercial or non-commercial, and by any means.
+In jurisdictions that recognize copyright laws, the author or authors of this
+software dedicate any and all copyright interest in the software to the public
+domain. We make this dedication for the benefit of the public at large and to
+the detriment of our heirs and successors. We intend this dedication to be an
+overt act of relinquishment in perpetuity of all present and future rights to
+this software under copyright law.
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
+ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/src/test/java/com/googlesource/gerrit/plugins/copyright/testdata/licenses/W3C.txt b/src/test/java/com/googlesource/gerrit/plugins/copyright/testdata/licenses/W3C.txt
new file mode 100644
index 0000000..44923d8
--- /dev/null
+++ b/src/test/java/com/googlesource/gerrit/plugins/copyright/testdata/licenses/W3C.txt
@@ -0,0 +1,11 @@
+/*
+ * Copyright (c) 2004 World Wide Web Consortium,
+ *
+ * (Massachusetts Institute of Technology, European Research Consortium for
+ * Informatics and Mathematics, Keio University). All Rights Reserved. This
+ * work is distributed under the W3C(r) Software License [1] in the hope that
+ * it will be useful, but WITHOUT ANY WARRANTY; without even the implied
+ * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ *
+ * [1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
+ */
diff --git a/src/test/java/com/googlesource/gerrit/plugins/copyright/testdata/licenses/WTFPL.txt b/src/test/java/com/googlesource/gerrit/plugins/copyright/testdata/licenses/WTFPL.txt
new file mode 100644
index 0000000..0d27608
--- /dev/null
+++ b/src/test/java/com/googlesource/gerrit/plugins/copyright/testdata/licenses/WTFPL.txt
@@ -0,0 +1,7 @@
+    <licenses>
+        <license>
+            <name>WTFPL</name>
+            <url>http://www.wtfpl.net/</url>
+        </license>
+    </licenses>
+
diff --git a/src/test/java/com/googlesource/gerrit/plugins/copyright/testdata/licenses/ZLIB.txt b/src/test/java/com/googlesource/gerrit/plugins/copyright/testdata/licenses/ZLIB.txt
new file mode 100644
index 0000000..faedfd0
--- /dev/null
+++ b/src/test/java/com/googlesource/gerrit/plugins/copyright/testdata/licenses/ZLIB.txt
@@ -0,0 +1,3 @@
+ *  This library is distributed under the zlib license, which can be found
+ *  in the file "COPYING.txt".
+ *
diff --git a/src/test/java/com/googlesource/gerrit/plugins/copyright/testdata/licenses/ZPL.txt b/src/test/java/com/googlesource/gerrit/plugins/copyright/testdata/licenses/ZPL.txt
new file mode 100644
index 0000000..5bb0085
--- /dev/null
+++ b/src/test/java/com/googlesource/gerrit/plugins/copyright/testdata/licenses/ZPL.txt
@@ -0,0 +1,42 @@
+/*
+ This Software is provided under the Zope Public License (ZPL) Version 2.1.
+
+ See the AUTHORS file for the list of contributors.
+
+ This license has been certified as open source. It has also been designated
+ as GPL compatible by the Free Software Foundation (FSF).
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+   1. Redistributions in source code must retain the accompanying copyright
+      notice, this list of conditions, and the following disclaimer.
+   2. Redistributions in binary form must reproduce the accompanying
+      copyright notice, this list of conditions, and the following disclaimer
+      in the documentation and/or other materials provided with the
+      distribution.
+   3. Names of the copyright holders must not be used to endorse or promote
+      products derived from this software without prior written permission
+      from the copyright holders.
+   4. The right to distribute this software or to use it for any purpose does
+      not give you the right to use Servicemarks (sm) or Trademarks (tm) of
+      the copyright holders.  Use of them is covered by separate agreement
+      with the copyright holders.
+   5. If any files are modified, you must cause the modified files to carry
+      prominent notices stating that you changed the files and the date of
+      any change.
+
+ Disclaimer
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY EXPRESSED
+ OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
+ EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
+ OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+ EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
diff --git a/src/test/java/com/googlesource/gerrit/plugins/copyright/tools/AndroidScanTest.sh b/src/test/java/com/googlesource/gerrit/plugins/copyright/tools/AndroidScanTest.sh
index 0e8e5d0..8dd4a87 100755
--- a/src/test/java/com/googlesource/gerrit/plugins/copyright/tools/AndroidScanTest.sh
+++ b/src/test/java/com/googlesource/gerrit/plugins/copyright/tools/AndroidScanTest.sh
@@ -46,6 +46,41 @@
   die "Expected first party and only first party owners in first_party.zip but found ${output}"
 fi
 
+echo "Testing AFL2_1 (3p) license"
+output=$("${scanner}" "${testdata}/licenses/AFL2_1.txt") || die "Failed scanning AFL2_1 license."
+licenses=$(echo "${output}" | cut -d ' ' -f1 | sort -u)
+if [[ "${licenses}" != "THIRD_PARTY" ]]; then
+  die "Expected third party and only third party licenses in AFL2_1 license but found ${output}"
+fi
+
+echo "Testing AFL3_0 (3p) license"
+output=$("${scanner}" "${testdata}/licenses/AFL3_0.txt") || die "Failed scanning AFL3_0 license."
+licenses=$(echo "${output}" | cut -d ' ' -f1 | sort -u)
+if [[ "${licenses}" != "THIRD_PARTY" ]]; then
+  die "Expected third party and only third party licenses in AFL3_0 license but found ${output}"
+fi
+
+echo "Testing APACHE1_1 (3p) license"
+output=$("${scanner}" "${testdata}/licenses/APACHE1_1.txt") || die "Failed scanning APACHE1_1 license."
+licenses=$(echo "${output}" | fgrep 'LICENSE' | cut -d ' ' -f1 | sort -u)
+if [[ "${licenses}" != "THIRD_PARTY" ]]; then
+  die "Expected third party and only third party licenses in APACHE1_1 license but found ${output}"
+fi
+
+echo "Testing ARTISTIC_LICENSE (3p) license"
+output=$("${scanner}" "${testdata}/licenses/ARTISTIC_LICENSE.txt") || die "Failed scanning ARTISTIC_LICENSE license."
+licenses=$(echo "${output}" | cut -d ' ' -f1 | sort -u)
+if [[ "${licenses}" != "THIRD_PARTY" ]]; then
+  die "Expected third party and only third party licenses in ARTISTIC_LICENSE license but found ${output}"
+fi
+
+echo "Testing BSL1_0 (3p) license"
+output=$("${scanner}" "${testdata}/licenses/BSL1_0.txt") || die "Failed scanning BSL1_0 license."
+licenses=$(echo "${output}" | cut -d ' ' -f1 | sort -u)
+if [[ "${licenses}" != "THIRD_PARTY" ]]; then
+  die "Expected third party and only third party licenses in BSL1_0 license but found ${output}"
+fi
+
 echo "Testing BSD2 (3p) license"
 output=$("${scanner}" "${testdata}/licenses/BSD2.txt") || die "Failed scanning BSD2 license."
 licenses=$(echo "${output}" | cut -d ' ' -f1 | sort -u)
@@ -53,6 +88,48 @@
   die "Expected third party and only third party licenses in BSD2 license but found ${output}"
 fi
 
+echo "Testing CC0 (3p) license"
+output=$("${scanner}" "${testdata}/licenses/CC0.txt") || die "Failed scanning CC0 license."
+licenses=$(echo "${output}" | cut -d ' ' -f1 | sort -u)
+if [[ "${licenses}" != "THIRD_PARTY" ]]; then
+  die "Expected third party and only third party licenses in CC0 license but found ${output}"
+fi
+
+echo "Testing EDL (3p) license"
+output=$("${scanner}" "${testdata}/licenses/EDL.txt") || die "Failed scanning EDL license."
+licenses=$(echo "${output}" | cut -d ' ' -f1 | sort -u)
+if [[ "${licenses}" != "THIRD_PARTY" ]]; then
+  die "Expected third party and only third party licenses in EDL license but found ${output}"
+fi
+
+echo "Testing EPL (3p) license"
+output=$("${scanner}" "${testdata}/licenses/EPL.txt") || die "Failed scanning EPL license."
+licenses=$(echo "${output}" | cut -d ' ' -f1 | sort -u)
+if [[ "${licenses}" != "THIRD_PARTY" ]]; then
+  die "Expected third party and only third party licenses in EPL license but found ${output}"
+fi
+
+echo "Testing FTL (3p) license"
+output=$("${scanner}" "${testdata}/licenses/FTL.txt") || die "Failed scanning FTL license."
+licenses=$(echo "${output}" | cut -d ' ' -f1 | sort -u)
+if [[ "${licenses}" != "THIRD_PARTY" ]]; then
+  die "Expected third party and only third party licenses in FTL license but found ${output}"
+fi
+
+echo "Testing LIBTIFF (3p) license"
+output=$("${scanner}" "${testdata}/licenses/LIBTIFF.txt") || die "Failed scanning LIBTIFF license."
+licenses=$(echo "${output}" | cut -d ' ' -f1 | sort -u)
+if [[ "${licenses}" != "THIRD_PARTY" ]]; then
+  die "Expected third party and only third party licenses in LIBTIFF license but found ${output}"
+fi
+
+echo "Testing LPL1_02 (3p) license"
+output=$("${scanner}" "${testdata}/licenses/LPL1_02.txt") || die "Failed scanning LPL1_02 license."
+licenses=$(echo "${output}" | cut -d ' ' -f1 | sort -u)
+if [[ "${licenses}" != "THIRD_PARTY" ]]; then
+  die "Expected third party and only third party licenses in LPL1_02 license but found ${output}"
+fi
+
 echo "Testing MIT (3p) license"
 output=$("${scanner}" "${testdata}/licenses/MIT.txt") || die "Failed scanning MIT license."
 licenses=$(echo "${output}" | cut -d ' ' -f1 | sort -u)
@@ -60,6 +137,62 @@
   die "Expected third party and only third party licenses in MIT license but found ${output}"
 fi
 
+echo "Testing NCSA (3p) license"
+output=$("${scanner}" "${testdata}/licenses/NCSA.txt") || die "Failed scanning NCSA license."
+licenses=$(echo "${output}" | cut -d ' ' -f1 | sort -u)
+if [[ "${licenses}" != "THIRD_PARTY" ]]; then
+  die "Expected third party and only third party licenses in NCSA license but found ${output}"
+fi
+
+echo "Testing OPENSSL (3p) license"
+output=$("${scanner}" "${testdata}/licenses/OPENSSL.txt") || die "Failed scanning OPENSSL license."
+licenses=$(echo "${output}" | cut -d ' ' -f1 | sort -u)
+if [[ "${licenses}" != "THIRD_PARTY" ]]; then
+  die "Expected third party and only third party licenses in OPENSSL license but found ${output}"
+fi
+
+echo "Testing PSFL (3p) license"
+output=$("${scanner}" "${testdata}/licenses/PSFL.txt") || die "Failed scanning PSFL license."
+licenses=$(echo "${output}" | cut -d ' ' -f1 | sort -u)
+if [[ "${licenses}" != "THIRD_PARTY" ]]; then
+  die "Expected third party and only third party licenses in PSFL license but found ${output}"
+fi
+
+echo "Testing UNICODE (3p) license"
+output=$("${scanner}" "${testdata}/licenses/UNICODE.txt") || die "Failed scanning UNICODE license."
+licenses=$(echo "${output}" | cut -d ' ' -f1 | sort -u)
+if [[ "${licenses}" != "THIRD_PARTY" ]]; then
+  die "Expected third party and only third party licenses in UNICODE license but found ${output}"
+fi
+
+echo "Testing UNLICENSE (3p) license"
+output=$("${scanner}" "${testdata}/licenses/UNLICENSE.txt") || die "Failed scanning UNLICENSE license."
+licenses=$(echo "${output}" | cut -d ' ' -f1 | sort -u)
+if [[ "${licenses}" != "THIRD_PARTY" ]]; then
+  die "Expected third party and only third party licenses in UNLICENSE license but found ${output}"
+fi
+
+echo "Testing W3C (3p) license"
+output=$("${scanner}" "${testdata}/licenses/W3C.txt") || die "Failed scanning W3C license."
+licenses=$(echo "${output}" | cut -d ' ' -f1 | sort -u)
+if [[ "${licenses}" != "THIRD_PARTY" ]]; then
+  die "Expected third party and only third party licenses in W3C license but found ${output}"
+fi
+
+echo "Testing ZLIB (3p) license"
+output=$("${scanner}" "${testdata}/licenses/ZLIB.txt") || die "Failed scanning ZLIB license."
+licenses=$(echo "${output}" | cut -d ' ' -f1 | sort -u)
+if [[ "${licenses}" != "THIRD_PARTY" ]]; then
+  die "Expected third party and only third party licenses in ZLIB license but found ${output}"
+fi
+
+echo "Testing ZPL (3p) license"
+output=$("${scanner}" "${testdata}/licenses/ZPL.txt") || die "Failed scanning ZPL license."
+licenses=$(echo "${output}" | cut -d ' ' -f1 | sort -u)
+if [[ "${licenses}" != "THIRD_PARTY" ]]; then
+  die "Expected third party and only third party licenses in ZPL license but found ${output}"
+fi
+
 echo "Testing UNKNOWN (3p) owner"
 output=$("${scanner}" "${testdata}/licenses/UNKNOWN.txt") || die "Failed scanning UNKNOWN owner."
 licenses=$(echo "${output}" | cut -d ' ' -f1 | sort -u)
@@ -98,6 +231,31 @@
   die "Expected third party and only third party owners in fobidden.cpio but found ${output}"
 fi
 
+echo "Testing NOT_A_CONTRIBUTION (forbidden) license"
+output=$("${scanner}" "${testdata}/licenses/NOT_A_CONTRIBUTION.txt") || die "Failed scanning NOT_A_CONTRIBUTION license."
+licenses=$(echo "${output}" | fgrep -v 'OWNER' | fgrep -v 'FIRST_PARTY' | cut -d ' ' -f1 | sort -u)
+if [[ "${licenses}" != "FORBIDDEN" ]]; then
+  die "Expected forbidden licenses in NOT_A_CONTRIBUTION license but found ${output}"
+fi
+
+echo "Testing SSPL (forbidden) license"
+output=$("${scanner}" "${testdata}/licenses/SSPL.txt") || die "Failed scanning SSPL license."
+licenses=$(echo "${output}" | fgrep -v 'OWNER' | cut -d ' ' -f1 | sort -u)
+if [[ "${licenses}" != "FORBIDDEN" ]]; then
+  die "Expected forbidden and only forbidden licenses in SSPL license but found ${output}"
+fi
+licenses=$(echo "${output}" | fgrep OWNER | cut -d ' ' -f1 | sort -u)
+if [[ "${licenses}" != "THIRD_PARTY" ]]; then
+  die "Expected third party and only third party owners in SSPL license but found ${output}"
+fi
+
+echo "Testing WTFPL (forbidden) license"
+output=$("${scanner}" "${testdata}/licenses/WTFPL.txt") || die "Failed scanning WTFPL license."
+licenses=$(echo "${output}" | fgrep -v 'OWNER' | cut -d ' ' -f1 | sort -u)
+if [[ "${licenses}" != "FORBIDDEN" ]]; then
+  die "Expected forbidden and only forbidden licenses in WTFPL license but found ${output}"
+fi
+
 echo "Testing scan of non-file error"
 "${scanner}" -v "${TEST_SRCDIR}/google3/javatests/com/google/devtools/compliance" 2>/dev/null \
     && die "Expected directory to fail scan."