@Test public void replace(){ Mask mask = new MaskImpl( new Slot[]{ new Slot(Slot.RULE_INPUT_REPLACE, '1', SlotValidatorSet.setOf(new SlotValidators.GenerousValidator())), new Slot(Slot.RULE_INPUT_REPLACE, '2', SlotValidatorSet.setOf(new SlotValidators.GenerousValidator())), new Slot(Slot.RULE_INPUT_REPLACE, '3', SlotValidatorSet.setOf(new SlotValidators.GenerousValidator())), new Slot(Slot.RULE_INPUT_REPLACE, null, SlotValidatorSet.setOf(new SlotValidators.GenerousValidator())) }, true ); assertEquals("123", mask.toString()); assertEquals(1,mask.insertFront("0")); assertEquals(2,mask.insertAt(1, "1")); assertEquals("013", mask.toString()); }
public static Slot any() { return new Slot(null, new SlotValidators.GenerousValidator()); }