LocalOcrScansTracker { public int getRemainingScans() { return sharedPreferences.get().getInt(KEY_AVAILABLE_SCANS, 0); } @Inject  LocalOcrScansTracker(@NonNull Lazy<SharedPreferences> sharedPreferences); @VisibleForTesting  LocalOcrScansTracker(@NonNull Lazy<SharedPreferences> sharedPreferences,
                         @NonNull Scheduler firstLocalScanReadScheduler); @NonNull Observable<Integer> getRemainingScansStream(); int getRemainingScans(); void setRemainingScans(int remainingScans); void decrementRemainingScans();  }
@Test public void getRemainingScans() { TestObserver<Integer> testObserver = localOcrScansTracker.getRemainingScansStream().test(); assertEquals(0, localOcrScansTracker.getRemainingScans()); testObserver.assertValues(0); testObserver.assertNotComplete(); testObserver.assertNoErrors(); }