@Test
  public void executorIsDirectWhenTestingPropertySetToTrue() throws Exception {
    // Use a custom ClassLoader to force a new class instance which will cause the
    // static initializers to run and observe the new system property set below.
    String lottieTaskName = LottieTask.class.getName();
    ClassLoader customLoader = new ClassLoader() {
      @Override public Class<?> loadClass(String name) throws ClassNotFoundException {
        if (name.equals(lottieTaskName)) {
          try (InputStream in = ClassLoader.getSystemResourceAsStream(lottieTaskName.replace('.', '/') + ".class")) {
            byte[] bytes = new byte[10 * 1024 * 1024];
            int read  = in.read(bytes);
            return defineClass(name, bytes, 0, read);
          } catch (IOException e) {
            throw new ClassNotFoundException(name, e);
          }
        }
        return super.loadClass(name);
      }
    };

    System.setProperty(LottieTask.DIRECT_EXECUTOR_PROPERTY_NAME, "true");
    try {
      Class<?> c = customLoader.loadClass(lottieTaskName);
      Executor e = (Executor) c.getField("EXECUTOR").get(null);

      AtomicBoolean isDirect = new AtomicBoolean();
      e.execute(() -> isDirect.set(true));
      assertTrue(isDirect.get());
    } finally {
      System.clearProperty(LottieTask.DIRECT_EXECUTOR_PROPERTY_NAME);
    }
  }
This hangs on CI but not locally.
lottie/src/test/java/com/airbnb/lottie/LottieTaskTest.java