Implementation of specification Pattern In JAVA