Added testing cases and fixing mock up of pattern.