Creating custom Rules in Java Code Test