// Path: src/main/java/org/jacis/trackedviews/TrackedView.java
// @JacisApi
// public interface TrackedView<V> extends JacisCloneable<TrackedView<V>> {
// 
//   /**
//    * Track modification of the passed object.
//    * The method is called during commit for each modified object.
//    * The method gets the old value (the original value at the point of time
//    * the value was first cloned to the transactional view of the currently committed transaction)
//    * and the new value that is now committed to the store.
//    *
//    * @param oldValue the value was first cloned to the transactional
//    * @param newValue the new value that is now committed to the store
//    */
//   void trackModification(V oldValue, V newValue);
// 
//   /**
//    * The implementation of this method should check the consistency of the tracked view.
//    * The method is called after executing a commit is finished.
//    * Note that the method is only called if this is specified in the specification of the store
//    * (see {@link org.jacis.container.JacisObjectTypeSpec#checkViewsOnCommit} (default is <code>false</code>)).
//    * The method gets all committed values as parameter.
//    * Usually the implementation goes through all these values and calculates the expected values of
//    * the tracked view on these values. If these values differ from the actually tracked values the
//    * method should throw an exception.
//    * 
//    * @param values all committed values stored in the store (after the just finished commit)
//    */
//   void checkView(List<V> values);
// 
//   /**
//    * Clear the tracked view.
//    * After executing this method the view should reflect the state where no committed values are stored.
//    * The method is only called by the {@link JacisStoreImpl#clear()} method.
//    */
//   void clear();
// 
//   /**
//    * @return if the implementation of the view is thread safe. Default is <code>false</code>. Overwrite this method to declare a view to be thread safe.
//    */
//   default boolean isThreadSafe() {
//     return false;
//   }
// 
// }


import org.jacis.trackedviews.TrackedView;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.List;

/*
 * Copyright (c) 2016. Jan Wiemer
 */

package org.jacis.testhelper;



/**
 * Test tracked view...
 *
 * @author Jan Wiemer
 */
public class TrackedTestView implements TrackedView<TestObject> {

  private static final Logger log = LoggerFactory.getLogger(TestObject.class);

  private int count = 0;
  private long sum = 0;

  @SuppressWarnings("unchecked")
  @Override
  public TrackedView<TestObject> clone() {
    try {

// Path: src/main/java/org/jacis/trackedviews/TrackedView.java
// @JacisApi
// public interface TrackedView<V> extends JacisCloneable<TrackedView<V>> {
// 
//   /**
//    * Track modification of the passed object.
//    * The method is called during commit for each modified object.
//    * The method gets the old value (the original value at the point of time
//    * the value was first cloned to the transactional view of the currently committed transaction)
//    * and the new value that is now committed to the store.
//    *
//    * @param oldValue the value was first cloned to the transactional
//    * @param newValue the new value that is now committed to the store
//    */
//   void trackModification(V oldValue, V newValue);
// 
//   /**
//    * The implementation of this method should check the consistency of the tracked view.
//    * The method is called after executing a commit is finished.
//    * Note that the method is only called if this is specified in the specification of the store
//    * (see {@link org.jacis.container.JacisObjectTypeSpec#checkViewsOnCommit} (default is <code>false</code>)).
//    * The method gets all committed values as parameter.
//    * Usually the implementation goes through all these values and calculates the expected values of
//    * the tracked view on these values. If these values differ from the actually tracked values the
//    * method should throw an exception.
//    * 
//    * @param values all committed values stored in the store (after the just finished commit)
//    */
//   void checkView(List<V> values);
// 
//   /**
//    * Clear the tracked view.
//    * After executing this method the view should reflect the state where no committed values are stored.
//    * The method is only called by the {@link JacisStoreImpl#clear()} method.
//    */
//   void clear();
// 
//   /**
//    * @return if the implementation of the view is thread safe. Default is <code>false</code>. Overwrite this method to declare a view to be thread safe.
//    */
//   default boolean isThreadSafe() {
//     return false;
//   }
// 
// }


// Path: src/test/java/org/jacis/testhelper/TrackedTestView.java
import org.jacis.trackedviews.TrackedView;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.List;

/*
 * Copyright (c) 2016. Jan Wiemer
 */

package org.jacis.testhelper;



/**
 * Test tracked view...
 *
 * @author Jan Wiemer
 */
public class TrackedTestView implements TrackedView<TestObject> {

  private static final Logger log = LoggerFactory.getLogger(TestObject.class);

  private int count = 0;
  private long sum = 0;

  @SuppressWarnings("unchecked")
  @Override
  public TrackedView<TestObject> clone() {
    try {

      return (TrackedView<TestObject>) super.clone();
