use 
.addRejectCheck(RejectAttributeChecker.DEFINED
.setDiscard(DiscardAttributeChecker.UNDEFINED

not need to write your own