RuleBaseElementId implements Serializable { @Override public String toString() { StringBuilder result = new StringBuilder(packageName); if (name != null) { result.append('.').append(name).toString(); } return result.toString(); } RuleBaseElementId(RuleBaseElementType type, String name);  RuleBaseElementId(RuleBaseElementType type, String packageName, String name);  RuleBaseElementId(); @XmlElement(required = true) RuleBaseElementType getType(); String getPackageName(); String getName(); void setType(RuleBaseElementType type); void setPackageName(String packageName); void setName(String name); @Override int hashCode(); @Override boolean equals(Object obj); @Override String toString(); static final String DEFAULT_RULE_PACKAGE; }
@Test public void testToStringWithDefaultConstructor_shouldBeEquals() throws Exception { assertEquals(RuleBaseElementId.DEFAULT_RULE_PACKAGE, new RuleBaseElementId().toString()); }
@Test public void testToStringWithNameOnly_shouldBeEquals() throws Exception { assertEquals(RuleBaseElementId.DEFAULT_RULE_PACKAGE + ".name", new RuleBaseElementId(RuleBaseElementType.Rule, "name").toString()); }
@Test public void testToStringWithNameAndPackage_shouldBeEquals() throws Exception { assertEquals("my.package.name", new RuleBaseElementId(RuleBaseElementType.Rule, "my.package", "name").toString()); }