@Test(expected = IllegalArgumentException.class) public void testFindDecendentOrSelfIfExistsForNull() { Assignment assignment = this.assignment.findDecendentOrSelfIfExists(null); }
public Assignment findDecendentOrSelfIfExists(JsonEntityBean principal) { if (principal == null) { String msg = "Argument 'principal' cannot be null"; throw new IllegalArgumentException(msg); } Assignment rslt = null; if (principal.getId().equals(this.principal.getId()) && principal .getEntityTypeAsString() .equals(this.principal.getEntityTypeAsString())) { rslt = this; } else { for (Assignment a : children) { rslt = a.findDecendentOrSelfIfExists(principal); if (rslt != null) { break; } } } return rslt; }
Assignment implements Comparable<Assignment>, Serializable { public Assignment findDecendentOrSelfIfExists(JsonEntityBean principal) { if (principal == null) { String msg = "Argument 'principal' cannot be null"; throw new IllegalArgumentException(msg); } Assignment rslt = null; if (principal.getId().equals(this.principal.getId()) && principal .getEntityTypeAsString() .equals(this.principal.getEntityTypeAsString())) { rslt = this; } else { for (Assignment a : children) { rslt = a.findDecendentOrSelfIfExists(principal); if (rslt != null) { break; } } } return rslt; } }
Assignment implements Comparable<Assignment>, Serializable { public Assignment findDecendentOrSelfIfExists(JsonEntityBean principal) { if (principal == null) { String msg = "Argument 'principal' cannot be null"; throw new IllegalArgumentException(msg); } Assignment rslt = null; if (principal.getId().equals(this.principal.getId()) && principal .getEntityTypeAsString() .equals(this.principal.getEntityTypeAsString())) { rslt = this; } else { for (Assignment a : children) { rslt = a.findDecendentOrSelfIfExists(principal); if (rslt != null) { break; } } } return rslt; } Assignment(String principalId, JsonEntityBean principal);  Assignment(String principalId, JsonEntityBean principal, Type type); }
Assignment implements Comparable<Assignment>, Serializable { public Assignment findDecendentOrSelfIfExists(JsonEntityBean principal) { if (principal == null) { String msg = "Argument 'principal' cannot be null"; throw new IllegalArgumentException(msg); } Assignment rslt = null; if (principal.getId().equals(this.principal.getId()) && principal .getEntityTypeAsString() .equals(this.principal.getEntityTypeAsString())) { rslt = this; } else { for (Assignment a : children) { rslt = a.findDecendentOrSelfIfExists(principal); if (rslt != null) { break; } } } return rslt; } Assignment(String principalId, JsonEntityBean principal);  Assignment(String principalId, JsonEntityBean principal, Type type); Assignment addChild(Assignment a); @Override int compareTo(Assignment a); Set<Assignment> getChildren(); JsonEntityBean getPrincipal(); Type getType(); void setType(Type type); Assignment findDecendentOrSelfIfExists(JsonEntityBean principal); String getPrincipalId(); }
Assignment implements Comparable<Assignment>, Serializable { public Assignment findDecendentOrSelfIfExists(JsonEntityBean principal) { if (principal == null) { String msg = "Argument 'principal' cannot be null"; throw new IllegalArgumentException(msg); } Assignment rslt = null; if (principal.getId().equals(this.principal.getId()) && principal .getEntityTypeAsString() .equals(this.principal.getEntityTypeAsString())) { rslt = this; } else { for (Assignment a : children) { rslt = a.findDecendentOrSelfIfExists(principal); if (rslt != null) { break; } } } return rslt; } Assignment(String principalId, JsonEntityBean principal);  Assignment(String principalId, JsonEntityBean principal, Type type); Assignment addChild(Assignment a); @Override int compareTo(Assignment a); Set<Assignment> getChildren(); JsonEntityBean getPrincipal(); Type getType(); void setType(Type type); Assignment findDecendentOrSelfIfExists(JsonEntityBean principal); String getPrincipalId();  }