### Question:
Restriction { public static Restriction identifier(String value) { return new Restriction(Type.IDENTIFIER, value); } private  Restriction(Type type, String value); Type getType(); String getValue(); static Restriction identifier(String value); static Restriction title(String value); static Restriction summary(String value); @Override boolean equals(final Object o); @Override int hashCode(); @Override String toString();  }### Answer:
@Test public void testIdentifier() { final Restriction id = Restriction.identifier("my id"); assertThat(id, is(notNullValue())); assertThat(id.getType(), is(Restriction.Type.IDENTIFIER)); assertThat(id.getValue(), is("my id")); }
@Test(expectedExceptions = IllegalArgumentException.class) public void testIdentifierWithNull() { Restriction.identifier(null); }