PigOperation extends Entity { @Override public void validateEntity() { if (Strings.isNullOrEmpty(this.getIdentity()) && (Strings.isNullOrEmpty(this.getJobName()) || Strings.isNullOrEmpty(this.getLogicalPlanHash()))) throw new IllegalArgumentException( "Either the Entity Id or the jobname and the logical plan must be " + "provided"); } PigOperation();  PigOperation(String logicalPlanHash, String jobName);  PigOperation(String id); @Override void validateEntity(); void setLogicalPlanHash(String logicalPlanHash); void setJobName(String jobName); String getJobName(); String getLogicalPlanHash(); Map<String, String> getIdAttrsMap();  }
@Test(expected = IllegalArgumentException.class) public void testInvalidPigOperation() { PigOperation pigOperation = new PigOperation(); pigOperation.validateEntity(); }