for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
package easytests.core.models.empty;
import easytests.core.models.ModelInterface;
import easytests.core.models.exceptions.CallMethodOnEmptyModelException;
import easytests.core.models.exceptions.CreateEmptyModelWithNullIdException;
/**
* @author malinink
*/
public abstract class AbstractModelEmpty implements ModelInterface {
private Integer id;
public AbstractModelEmpty() {
}
public AbstractModelEmpty(Integer id) {
if (id == null) {
throw new CreateEmptyModelWithNullIdException();
this.id = id;
@Override
public Integer getId() {
if (this.id == null) {
throw new CallMethodOnEmptyModelException();
return this.id;
public boolean equals(Object object) {
if (this == object) {
return true;
if (getClass() != object.getClass()) {
return false;
final AbstractModelEmpty other = (AbstractModelEmpty) object;
if (this.id == other.id) {
public int hashCode() {
return this.id == null ? -1 : this.id;