@Test public void testNullName() throws Exception { BaseCompact baseCompact = BaseCompact.create("id-1", null); ImmutableList<String> violations = validator.validate(baseCompact); assertThat(violations.size(), is(1)); assertThat(violations.get(0), containsString("may not be null")); }
public static BaseCompact create(String id, String name) { BaseCompact result = new BaseCompact(); result.setId(id); result.setName(name); return result; }
BaseCompact implements Named { public static BaseCompact create(String id, String name) { BaseCompact result = new BaseCompact(); result.setId(id); result.setName(name); return result; } }
BaseCompact implements Named { public static BaseCompact create(String id, String name) { BaseCompact result = new BaseCompact(); result.setId(id); result.setName(name); return result; }  }
BaseCompact implements Named { public static BaseCompact create(String id, String name) { BaseCompact result = new BaseCompact(); result.setId(id); result.setName(name); return result; }  static BaseCompact create(String id, String name); String getId(); void setId(String id); String getName(); void setName(String name); @Override boolean equals(Object o); @Override int hashCode(); }
BaseCompact implements Named { public static BaseCompact create(String id, String name) { BaseCompact result = new BaseCompact(); result.setId(id); result.setName(name); return result; }  static BaseCompact create(String id, String name); String getId(); void setId(String id); String getName(); void setName(String name); @Override boolean equals(Object o); @Override int hashCode();  }