ShortUrl implements Serializable { @Override public String toString() { return ToStringBuilder.reflectionToString(this, ToStringStyle.MULTI_LINE_STYLE); }  static Long shortCodeToId(String shortCode); Long getId(); void setId(Long id); String getFullUrl(); void setFullUrl(String fullUrl); @Transient String getShortUrl(); @Override int hashCode(); @Override boolean equals(Object obj); @Override String toString();  }
@Test public void fullUrlCannotBeNull() { constraintViolations = validator.validate(shortUrl); assertEquals(1, constraintViolations.size()); violation = constraintViolations.iterator().next(); assertEquals("Full URL cannot be blank", violation.getMessage()); assertEquals("fullUrl", violation.getPropertyPath().toString()); }