### Question:
Constraint { public Collection<String> getAllowedValues() { return allowedValues; } Constraint(final String name, final String... allowedValue); String getName(); Collection<String> getAllowedValues(); @Override int hashCode(); @Override boolean equals(final Object obj); @Override String toString();  }### Answer:
@Test public void shouldSetAllowedValues() { final String aV1 = "av1"; final String aV2 = "aV2"; Constraint constraint = new Constraint("name", aV1); assertThat(constraint.getAllowedValues(),hasSize(1)); assertThat(constraint.getAllowedValues(),hasItem(aV1)); constraint = new Constraint("name",aV1,aV2); assertThat(constraint.getAllowedValues(),hasSize(2)); assertThat(constraint.getAllowedValues(),hasItem(aV1)); assertThat(constraint.getAllowedValues(),hasItem(aV2)); }