### Question:
DefaultObjectNameGenerator implements ObjectNameGenerator { @Override public String relationshipName(DbRelationship... relationshipChain) { if (relationshipChain == null || relationshipChain.length < 1) { throw new IllegalArgumentException("At least on relationship is expected: " + relationshipChain); } String name = isToMany(relationshipChain) ? toManyRelationshipName(relationshipChain) : toOneRelationshipName(relationshipChain); return Util.underscoredToJava(name, false); } DefaultObjectNameGenerator();  DefaultObjectNameGenerator(DbEntityNameStemmer dbEntityNameStemmer); @Override String relationshipName(DbRelationship... relationshipChain); @Override String objEntityName(DbEntity dbEntity); @Override String objAttributeName(DbAttribute attr);  }### Answer:
@Test public void testRelationshipName_LowerCase_Underscores() { DbRelationship r1 = makeRelationship("painting", "artist_id", "artist", "artist_id", false); assertEquals("artist", generator.relationshipName(r1)); DbRelationship r2 = makeRelationship("artist", "artist_id", "painting", "artist_id", true); assertEquals("paintings", generator.relationshipName(r2)); DbRelationship r3 = makeRelationship("person", "mother_id", "person", "person_id", false); assertEquals("mother", generator.relationshipName(r3)); DbRelationship r4 = makeRelationship("person", "person_id", "person", "mother_id", true); assertEquals("people", generator.relationshipName(r4)); DbRelationship r5 = makeRelationship("person", "shipping_address_id", "address", "id", false); assertEquals("shippingAddress", generator.relationshipName(r5)); DbRelationship r6 = makeRelationship("person", "id", "address", "person_id", true); assertEquals("addresses", generator.relationshipName(r6)); }
@Test public void testRelationshipName_UpperCase_Underscores() { DbRelationship r1 = makeRelationship("PAINTING", "ARTIST_ID", "ARTIST", "ARTIST_ID", false); assertEquals("artist", generator.relationshipName(r1)); DbRelationship r2 = makeRelationship("ARTIST", "ARTIST_ID", "PAINTING", "ARTIST_ID", true); assertEquals("paintings", generator.relationshipName(r2)); DbRelationship r3 = makeRelationship("PERSON", "MOTHER_ID", "PERSON", "PERSON_ID", false); assertEquals("mother", generator.relationshipName(r3)); DbRelationship r4 = makeRelationship("PERSON", "PERSON_ID", "PERSON", "MOTHER_ID", true); assertEquals("people", generator.relationshipName(r4)); DbRelationship r5 = makeRelationship("PERSON", "SHIPPING_ADDRESS_ID", "ADDRESS", "ID", false); assertEquals("shippingAddress", generator.relationshipName(r5)); DbRelationship r6 = makeRelationship("PERSON", "ID", "ADDRESS", "PERSON_ID", true); assertEquals("addresses", generator.relationshipName(r6)); }