// Path: src/test/java/org/ehcache/sizeof/filteredtest/AnnotationFilteredPackage.java
// public class AnnotationFilteredPackage {
// 
//     private final byte[] bigArray = new byte[16 * 1024];
// }
// 
// Path: src/test/java/org/ehcache/sizeof/filteredtest/custom/CustomAnnotationFilteredPackage.java
// public class CustomAnnotationFilteredPackage {
// }


import org.ehcache.sizeof.annotations.IgnoreSizeOf;
import org.ehcache.sizeof.filteredtest.AnnotationFilteredPackage;
import org.ehcache.sizeof.filteredtest.custom.CustomAnnotationFilteredPackage;
import org.ehcache.sizeof.filters.AnnotationSizeOfFilter;
import org.junit.BeforeClass;
import org.junit.Test;
import static org.hamcrest.CoreMatchers.allOf;
import static org.hamcrest.Matchers.greaterThan;
import static org.hamcrest.Matchers.lessThan;
import static org.hamcrest.core.IsEqual.equalTo;
import static org.junit.Assert.assertThat;

    @Test
    public void testAnnotationFiltering() throws Exception {
        SizeOf sizeOf = new CrossCheckingSizeOf(new AnnotationSizeOfFilter());

        assertThat(deepSizeOf(sizeOf, new AnnotationFilteredField()), allOf(greaterThan(128L), lessThan(16 * 1024L)));
        assertThat(deepSizeOf(sizeOf, new AnnotationFilteredClass()), equalTo(0L));
        assertThat(deepSizeOf(sizeOf, new AnnotationFilteredPackage()), equalTo(0L));

        assertThat(deepSizeOf(sizeOf, new AnnotationFilteredFieldSubclass()), allOf(greaterThan(128L), lessThan(16 * 1024L)));

        long emptyReferrerSize = deepSizeOf(sizeOf, new Referrer(null));
        assertThat(deepSizeOf(sizeOf, new Referrer(new AnnotationFilteredClass())), equalTo(emptyReferrerSize));
        assertThat(deepSizeOf(sizeOf, new Referrer(new AnnotationFilteredPackage())), equalTo(emptyReferrerSize));
        assertThat(deepSizeOf(sizeOf, new Parent()), equalTo(0L));
        assertThat(deepSizeOf(sizeOf, new Child()), equalTo(0L));
        assertThat(deepSizeOf(sizeOf, new ChildChild()), equalTo(0L));
        assertThat(deepSizeOf(sizeOf, new ChildChildChild()), equalTo(0L));
    }

    @Test
    @SuppressWarnings("unchecked")
    public void testCustomAnnotationFiltering() throws Exception {
        SizeOf sizeOf = new CrossCheckingSizeOf(new AnnotationSizeOfFilter());
        assertThat(deepSizeOf(sizeOf, new MatchingPatternOrNotAnnotationFilteredField()), allOf(greaterThan(128L), lessThan(16 * 1024L)));
        assertThat(deepSizeOf(sizeOf, new MatchingPatternAnnotation()), equalTo(0L));
        assertThat(deepSizeOf(sizeOf, new MatchingPatternAnnotationChild()), equalTo(0L));
        assertThat(deepSizeOf(sizeOf, new MatchingPatternAnnotationNoInheritedChild()), allOf(greaterThan(4L)));
        assertThat(deepSizeOf(sizeOf, new NonMatchingPatternAnnotation1()), allOf(greaterThan(4L)));
        assertThat(deepSizeOf(sizeOf, new NonMatchingPatternAnnotation2()), allOf(greaterThan(4L)));
// Path: src/test/java/org/ehcache/sizeof/filteredtest/AnnotationFilteredPackage.java
// public class AnnotationFilteredPackage {
// 
//     private final byte[] bigArray = new byte[16 * 1024];
// }
// 
// Path: src/test/java/org/ehcache/sizeof/filteredtest/custom/CustomAnnotationFilteredPackage.java
// public class CustomAnnotationFilteredPackage {
// }


// Path: src/test/java/org/ehcache/sizeof/FilteredSizeOfTest.java
import org.ehcache.sizeof.annotations.IgnoreSizeOf;
import org.ehcache.sizeof.filteredtest.AnnotationFilteredPackage;
import org.ehcache.sizeof.filteredtest.custom.CustomAnnotationFilteredPackage;
import org.ehcache.sizeof.filters.AnnotationSizeOfFilter;
import org.junit.BeforeClass;
import org.junit.Test;
import static org.hamcrest.CoreMatchers.allOf;
import static org.hamcrest.Matchers.greaterThan;
import static org.hamcrest.Matchers.lessThan;
import static org.hamcrest.core.IsEqual.equalTo;
import static org.junit.Assert.assertThat;


    @Test
    public void testAnnotationFiltering() throws Exception {
        SizeOf sizeOf = new CrossCheckingSizeOf(new AnnotationSizeOfFilter());

        assertThat(deepSizeOf(sizeOf, new AnnotationFilteredField()), allOf(greaterThan(128L), lessThan(16 * 1024L)));
        assertThat(deepSizeOf(sizeOf, new AnnotationFilteredClass()), equalTo(0L));
        assertThat(deepSizeOf(sizeOf, new AnnotationFilteredPackage()), equalTo(0L));

        assertThat(deepSizeOf(sizeOf, new AnnotationFilteredFieldSubclass()), allOf(greaterThan(128L), lessThan(16 * 1024L)));

        long emptyReferrerSize = deepSizeOf(sizeOf, new Referrer(null));
        assertThat(deepSizeOf(sizeOf, new Referrer(new AnnotationFilteredClass())), equalTo(emptyReferrerSize));
        assertThat(deepSizeOf(sizeOf, new Referrer(new AnnotationFilteredPackage())), equalTo(emptyReferrerSize));
        assertThat(deepSizeOf(sizeOf, new Parent()), equalTo(0L));
        assertThat(deepSizeOf(sizeOf, new Child()), equalTo(0L));
        assertThat(deepSizeOf(sizeOf, new ChildChild()), equalTo(0L));
        assertThat(deepSizeOf(sizeOf, new ChildChildChild()), equalTo(0L));
    }

    @Test
    @SuppressWarnings("unchecked")
    public void testCustomAnnotationFiltering() throws Exception {
        SizeOf sizeOf = new CrossCheckingSizeOf(new AnnotationSizeOfFilter());
        assertThat(deepSizeOf(sizeOf, new MatchingPatternOrNotAnnotationFilteredField()), allOf(greaterThan(128L), lessThan(16 * 1024L)));
        assertThat(deepSizeOf(sizeOf, new MatchingPatternAnnotation()), equalTo(0L));
        assertThat(deepSizeOf(sizeOf, new MatchingPatternAnnotationChild()), equalTo(0L));
        assertThat(deepSizeOf(sizeOf, new MatchingPatternAnnotationNoInheritedChild()), allOf(greaterThan(4L)));
        assertThat(deepSizeOf(sizeOf, new NonMatchingPatternAnnotation1()), allOf(greaterThan(4L)));
        assertThat(deepSizeOf(sizeOf, new NonMatchingPatternAnnotation2()), allOf(greaterThan(4L)));
        assertThat(deepSizeOf(sizeOf, new CustomAnnotationFilteredPackage()), equalTo(0L));