Add missing use of Filter.appliesTo().

Also fixed CustomFilter's implementation of appliesTo() to account for
autoboxing (i.e. handle primitive fields).