### Question:
ManyToManyCandidateEntity { public static ManyToManyCandidateEntity build(ObjEntity joinEntity) { ArrayList<ObjRelationship> relationships = new ArrayList<>(joinEntity.getRelationships()); if (relationships.size() != 2 || (relationships.get(0).getDbRelationships().isEmpty() || relationships.get(1).getDbRelationships().isEmpty())) { return null; } ManyToManyCandidateEntity candidateEntity = new ManyToManyCandidateEntity(joinEntity, relationships); if (candidateEntity.isManyToMany()) { return candidateEntity; } return null; } private  ManyToManyCandidateEntity(ObjEntity entityValue, List<ObjRelationship> relationships); static ManyToManyCandidateEntity build(ObjEntity joinEntity); void optimizeRelationships(ObjectNameGenerator nameGenerator);  }### Answer:
@Test public void testMatchingForManyToManyEntity() throws Exception { ObjEntity manyToManyEntity = map.getObjEntity("Table1Table2"); assertNotNull(ManyToManyCandidateEntity.build(manyToManyEntity)); }
@Test public void testMatchingForNotManyToManyEntity() throws Exception { ObjEntity entity = map.getObjEntity("Table1"); assertNull(ManyToManyCandidateEntity.build(entity)); }