@Test void testNoSuchElement() throws NoSuchElementException { Assertions.assertThrows( NoSuchElementException.class, () -> { assertTrue( repository .getCopybookStorableFromCache("NOT-PRESENT-ITEM") .get() .getName() .equalsIgnoreCase("NOT-PRESENT-ITEM")); }); }
@Override public Optional<CopybookModel> getCopybookStorableFromCache(@NonNull String name) { return Optional.ofNullable(cache.getIfPresent(name)); }
CopybookRepositoryLRU implements CopybookRepository { @Override public Optional<CopybookModel> getCopybookStorableFromCache(@NonNull String name) { return Optional.ofNullable(cache.getIfPresent(name)); } }
CopybookRepositoryLRU implements CopybookRepository { @Override public Optional<CopybookModel> getCopybookStorableFromCache(@NonNull String name) { return Optional.ofNullable(cache.getIfPresent(name)); } @Inject  CopybookRepositoryLRU(
      @Named("CACHE-MAX-SIZE") int cacheSize,
      @Named("CACHE-DURATION") int duration,
      @Named("CACHE-TIME-UNIT") String timeUnitName);   CopybookRepositoryLRU(int cacheSize, int duration, String timeUnitName, Ticker ticker); }
CopybookRepositoryLRU implements CopybookRepository { @Override public Optional<CopybookModel> getCopybookStorableFromCache(@NonNull String name) { return Optional.ofNullable(cache.getIfPresent(name)); } @Inject  CopybookRepositoryLRU(
      @Named("CACHE-MAX-SIZE") int cacheSize,
      @Named("CACHE-DURATION") int duration,
      @Named("CACHE-TIME-UNIT") String timeUnitName);   CopybookRepositoryLRU(int cacheSize, int duration, String timeUnitName, Ticker ticker); @Override Optional<CopybookModel> getCopybookStorableFromCache(@NonNull String name); @Override synchronized void persist(@NonNull CopybookModel copybookModel); @Override String logContent(); @Override int size(); @Override boolean isStored(@NonNull String name); @Override void invalidateCache(); }
CopybookRepositoryLRU implements CopybookRepository { @Override public Optional<CopybookModel> getCopybookStorableFromCache(@NonNull String name) { return Optional.ofNullable(cache.getIfPresent(name)); } @Inject  CopybookRepositoryLRU(
      @Named("CACHE-MAX-SIZE") int cacheSize,
      @Named("CACHE-DURATION") int duration,
      @Named("CACHE-TIME-UNIT") String timeUnitName);   CopybookRepositoryLRU(int cacheSize, int duration, String timeUnitName, Ticker ticker); @Override Optional<CopybookModel> getCopybookStorableFromCache(@NonNull String name); @Override synchronized void persist(@NonNull CopybookModel copybookModel); @Override String logContent(); @Override int size(); @Override boolean isStored(@NonNull String name); @Override void invalidateCache();  }