LegacyPk implements Comparable<LegacyPk>, Serializable { @Transient public boolean isEmpty() { return !isCodeSet() && !isDeptSet() && !isNameSet(); } LegacyPk();  LegacyPk(String code, Integer dept, String name); @Transient boolean areFieldsSet(); @Transient boolean isEmpty(); @NotEmpty @Size(max = 8) @Column(name = "CODE", nullable = false, length = 8) String getCode(); void setCode(String code); LegacyPk code(String code); @Transient boolean isCodeSet(); @Digits(integer = 10, fraction = 0) @NotNull @Column(name = "DEPT", nullable = false, precision = 10) Integer getDept(); void setDept(Integer dept); LegacyPk dept(Integer dept); @Transient boolean isDeptSet(); @NotEmpty @Size(max = 16) @Column(name = "NAME", nullable = false, length = 16) String getName(); void setName(String name); LegacyPk name(String name); @Transient boolean isNameSet(); @Override boolean equals(Object other); @Override int hashCode(); @Override int compareTo(LegacyPk other); @Override String toString(); static LegacyPk fromString(String string);  }
@Test public void isEmptyTrue() { LegacyPk cpk = new LegacyPk(); assertThat(cpk.isEmpty()).isTrue(); }