PriorityImpl extends XliffAttributeImpl implements Priority { public PriorityImpl(int priority) { super(NAME, Integer.toString(priority)); if ((priority < 1) || (priority > 10)) { String msg = MessageFormat .format( "Priority must have a value from 1 to 10, but has a value of {0}", priority); throw new IllegalArgumentException(msg); } this.priority = priority; } PriorityImpl(int priority); int getPriority();  }
@Test public void testPriorityImpl() { PriorityImpl attr = new PriorityImpl(4); assertEquals(new Integer(4), new Integer(attr.getPriority())); try { attr = new PriorityImpl(0); fail("Expected IllegalArgumentException"); } catch (IllegalArgumentException e) { } try { attr = new PriorityImpl(11); fail("Expected IllegalArgumentException"); } catch (IllegalArgumentException e) { } }