@Test
  public void testTableValidJar() throws IOException {
    Path outputDirectory = Paths.get("target", "test-classes");
    String className = getFullClassName("ObsoleteMethodObserver");
    Path classFile = Paths.get(className.replace('.', '/') + ".class");
    Path fullClassFile = outputDirectory.resolve(classFile);

    Path tempJarFile = Files.createTempFile("coprocessor-validator-test-", ".jar");

    try {
      try (OutputStream fileStream = Files.newOutputStream(tempJarFile);
        JarOutputStream jarStream = new JarOutputStream(fileStream);
        InputStream classStream = Files.newInputStream(fullClassFile)) {
        ZipEntry entry = new ZipEntry(classFile.toString());
        jarStream.putNextEntry(entry);

        ByteStreams.copy(classStream, jarStream);
      }

      String tempJarFileUri = tempJarFile.toUri().toString();

      List<CoprocessorViolation> violations =
        validateTable(tempJarFileUri, "ObsoleteMethodObserver");
      assertEquals(1, violations.size());

      CoprocessorViolation violation = violations.get(0);
      assertEquals(getFullClassName("ObsoleteMethodObserver"), violation.getClassName());
      assertEquals(Severity.WARNING, violation.getSeverity());
      assertTrue(violation.getMessage().contains("was removed from new coprocessor API"));
    } finally {
      Files.delete(tempJarFile);
    }
  }
ObsoleteMethod coprocessor implements preCreateTable method which has HRegionInfo parameters.
In our current implementation, we pass only RegionInfo parameters, so this method won't be
called by HBase at all.
hbase-server/src/test/java/org/apache/hadoop/hbase/tool/coprocessor/CoprocessorValidatorTest.java