### Question:
TableInfoFactory { public static TableInfo getTableInfo(final Class<?> clazz) { String tableName = FieldDefaultNaming.getJavanameToDBnameDefaultMapping(clazz.getSimpleName()); String schemaName = ""; final Optional<Table> optionalAnnotation = ReflectionUtils.findAnnotation(clazz, Table.class); if (optionalAnnotation.isPresent()) { final Table annotation = optionalAnnotation.get(); tableName = annotation.tableName() == null || annotation.tableName().isEmpty() ? tableName : annotation.tableName(); schemaName = annotation.schemaName(); } return new TableInfo(tableName, schemaName); } private  TableInfoFactory(); static TableInfo getTableInfo(final Class<?> clazz);  }### Answer:
@Test public void testTableNameResolution() { final String annotatedTableName = "tableFromAnnotation"; assertEquals("BEAN_WITHOUT_TABLE_ANNOTATION", TableInfoFactory.getTableInfo(BeanWithoutTableAnnotation.class).getTableName()); assertEquals(annotatedTableName, TableInfoFactory.getTableInfo(BeanWithTableAnnotation.class).getTableName()); assertEquals(annotatedTableName, TableInfoFactory.getTableInfo(BeanWithAnnotatedParent.class).getTableName()); assertEquals(annotatedTableName, TableInfoFactory.getTableInfo(BeanWithAnnotatedInterface.class).getTableName()); }