stackIf implemented on ArrayList, Complete