SimpleHibernateEntityResolver extends SimpleEntityResolver implements EntityResolver { @Override public String resolve(Class<?> entityClass) { if (entityClass.isAnnotationPresent(Table.class)) { Table annotation = entityClass.getAnnotation(Table.class); if (!Strings.isNullOrEmpty(annotation.name())) { return annotation.name(); } } if (entityClass.isAnnotationPresent(Entity.class)) { Entity annotation = entityClass.getAnnotation(Entity.class); if (!Strings.isNullOrEmpty(annotation.name())) { return annotation.name(); } } return entityClass.getSimpleName(); }  @Override String resolve(Class<?> entityClass);  }
@Test public void resolve_collectionName_entity() { assertEquals("without", resolver.resolve(No.class)); }
@Test public void resolve_collectionName_table() { assertEquals("with", resolver.resolve(Yes.class)); }
@Test public void resolve_collectionName_default() { assertEquals("Maybe", resolver.resolve(Maybe.class)); }