public void testRemove() { // Set up RuleStack stack = new RuleStack(); stack.push(RuleConstants.ACCESS_PATTERN_VALIDATION); stack.push(RuleConstants.COLLAPSE_SOURCE); stack.push(RuleConstants.ACCESS_PATTERN_VALIDATION); // Remove all instances of ASSIGN_OUTPUT_ELEMENTS stack.remove(RuleConstants.ACCESS_PATTERN_VALIDATION); // Verify size and pop'ed values assertEquals(1, stack.size()); assertEquals(RuleConstants.COLLAPSE_SOURCE, stack.pop()); assertEquals(null, stack.pop()); }