package stexfires.core.filter;

import stexfires.core.Record;

import java.util.Objects;

/**
 * @author Mathias Kalb
 * @since 0.1
 */
public class ClassFilter<T extends Record> implements RecordFilter<T> {

    protected final Class<? extends Record> recordClass;

    public ClassFilter(Class<? extends Record> recordClass) {
        Objects.requireNonNull(recordClass);
        this.recordClass = recordClass;
    }

    @Override
    public boolean isValid(T record) {
        return recordClass.equals(record.getClass());
    }

}

@@ -73,23 +73,89 @@
 va.util.
-Objects
+Collection;%0Aimport java.util.Objects;%0Aimport java.util.function.Predicate
 ;%0A%0A/**%0A 
@@ -288,16 +288,26 @@
 d final 
+Predicate%3C
 Class%3C? 
@@ -321,28 +321,32 @@
  Record%3E
- recordClass
+%3E classPredicate
 ;%0A%0A    p
@@ -363,16 +363,26 @@
 sFilter(
+Predicate%3C
 Class%3C? 
@@ -396,28 +396,32 @@
  Record%3E
- recordClass
+%3E classPredicate
 ) %7B%0A    
@@ -451,21 +451,177 @@
 ull(
-record
+classPredicate);%0A        this.classPredicate = classPredicate;%0A    %7D%0A%0A    public static %3CT extends Record%3E ClassFilter%3CT%3E equalTo(Class%3C? extends Record%3E compare
 Class)
-;
+ %7B
 %0A   
@@ -629,38 +629,261 @@
     
-this.recordClass = recordClass
+return new ClassFilter%3C%3E(recordClass -%3E Objects.equals(recordClass, compareClass));%0A    %7D%0A%0A    public static %3CT extends Record%3E ClassFilter%3CT%3E containedIn(Collection%3CClass%3C? extends Record%3E%3E classes) %7B%0A        return new ClassFilter%3C%3E(classes::contains)
 ;%0A  
@@ -959,26 +959,27 @@
 urn 
-recordClass.equals
+classPredicate.test
 (rec

Refactor ClassFilter