CudaVerifier { public boolean verify() { if (accelerationMode.isUsingCuda()) { return cudaDetector.isCompatibleCudaInstalled(); } else { return true; } } @Inject  CudaVerifier(AccelerationMode accelerationMode,
                      CudaDetector cudaDetector,
                      @Named("cudaProperties") Properties cudaProperties); void verifyCuda(); boolean verify();  }
@Test public void testVerifyNonCudaRuntime() { CudaVerifier verifier = new NonExitingVerifier(() -> false, () -> false); assertTrue("Not using CUDA should always pass verification", verifier.verify()); }
@Test public void testUsingCudaWithNoAvailableRuntime() { CudaVerifier verifier = new NonExitingVerifier(() -> true, () -> false); assertFalse("Using CUDA but no available runtime should fail verification", verifier.verify()); }