CudaVerifier { public void verifyCuda() { if (!verify()) { String message = "This version of GRIP requires CUDA version " + cudaVersion + " to be installed and an NVIDIA graphics card in your computer. " + "If your computer does not have an NVIDIA graphics card, use a version of GRIP " + "without CUDA acceleration. Otherwise, you need to install the appropriate CUDA " + "runtime for your computer."; logger.severe(message); exit(); } } @Inject  CudaVerifier(AccelerationMode accelerationMode,
                      CudaDetector cudaDetector,
                      @Named("cudaProperties") Properties cudaProperties); void verifyCuda(); boolean verify();  }
@Test public void testExitsWhenFailsVerification() { NonExitingVerifier verifier = new NonExitingVerifier(() -> true, () -> false); verifier.verifyCuda(); assertEquals(1, verifier.getExitCount()); }