test_class.file: imcache-examples/src/test/java/com/cetsoft/imcache/examples/VersionedOffHeapCacheExampleTest.java
test_class.identifier: VersionedOffHeapCacheExampleTest
test_case.body: @Test
    public void example() {
      VersionedOffHeapCacheExample.example();
    }
test_case.class_method_signature: VersionedOffHeapCacheExampleTest.example()
test_case.full_signature: @Test public void example()
test_case.identifier: example
test_case.invocations: example
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void example()
focal_class.file: imcache-examples/src/main/java/com/cetsoft/imcache/examples/VersionedOffHeapCacheExample.java
focal_class.identifier: VersionedOffHeapCacheExample
focal_class.class_method_signature: VersionedOffHeapCacheExample.example()
focal_class.full_signature: public static void example()
focal_class.identifier: example
focal_class.modifiers: public static
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void example()
focal_class.class_method_signature: VersionedOffHeapCacheExample.getRandomString()
focal_class.full_signature: private static String getRandomString()
focal_class.identifier: getRandomString
focal_class.modifiers: private static
focal_class.parameters: ()
focal_class.return: String
focal_class.signature: String getRandomString()
focal_class.class_method_signature: VersionedOffHeapCacheExample.main(String[] args)
focal_class.full_signature: public static void main(String[] args)
focal_class.identifier: main
focal_class.modifiers: public static
focal_class.parameters: (String[] args)
focal_class.return: void
focal_class.signature: void main(String[] args)
focal_method.body: public static void example() {
      OffHeapByteBufferStore bufferStore = new OffHeapByteBufferStore(10000, 10);
      final Cache<String, VersionedItem<String>> cache = CacheBuilder.versionedOffHeapCache()
          .storage(bufferStore)
          .build();
      ExecutorService service = Executors.newFixedThreadPool(3);
      for (int i = 0; i < 100000; i++) {
        service.execute(() -> {
          try {
            Thread.sleep(100);
          } catch (InterruptedException e) {
            e.printStackTrace();
          }
          while (true) {
            try {
              VersionedItem<String> value = cache.get("apple");
              String newValue = getRandomString();
              if (value == null) {
                cache.put("apple", new SimpleItem<>(newValue));
              } else {
                value = value.update(newValue);
                cache.put("apple", value);
              }
              System.out.println(cache.get("apple").getValue());
              break;
            } catch (StaleItemException ex) {
              ex.printStackTrace();
            }
          }
          VersionedItem<String> item = cache.get("apple");
          System.out.println(item.getVersion());
        });
      }
    }
focal_method.class_method_signature: VersionedOffHeapCacheExample.example()
focal_method.full_signature: public static void example()
focal_method.identifier: example
focal_method.invocations: build storage versionedOffHeapCache newFixedThreadPool execute sleep printStackTrace get getRandomString put update put println getValue get printStackTrace get println getVersion
focal_method.modifiers: public static
focal_method.parameters: ()
focal_method.return: void
focal_method.signature: void example()