private static @NotNull StateCache<MyState> createCache(final File cacheStoreDirectory) throws IOException {
    return new StateCache<>(new File(cacheStoreDirectory, BINDINGS_FILE_NAME)) {
      @Override
      public MyState read(final DataInput stream) throws IOException {
        return new MyState(stream.readLong(), stream.readUTF());
      }

      @Override
      public void write(final MyState myState, final DataOutput out) throws IOException {
        out.writeLong(myState.getFormTimeStamp());
        out.writeUTF(myState.getClassName());
      }
    };
  }
private static @NotNull StateCache<MyState> createCache(final File cacheStoreDirectory)