CollectionHelper extends Helper<MorphixMongoConnector> { public String getCollection(Class<?> cls) { Conditions.notNull(cls); String collectionName = Definitions.DEFAULT_COLLECTION; Collection annotation = Search.getInheritedAnnotation(cls, Collection.class); if (annotation != null) { collectionName = annotation.value(); } if (collectionName.equals(Definitions.DEFAULT_COLLECTION)) { collectionName = generate(cls); } return collectionName; } CollectionHelper(MorphixMongoConnector connector); boolean isSnakeCase(); void setSnakeCase(boolean snakeCase); boolean isLowerCase(); void setLowerCase(boolean lowerCase); String generate(Class<?> clazz); String getCollection(Class<?> cls);  }
@Test void getCollection() { CollectionHelper helper = new CollectionHelper(null); assertEquals("custom_name", helper.getCollection(MyClass.class)); assertEquals("automated_class", helper.getCollection(AutomatedClass.class)); assertEquals("basic_class", helper.getCollection(BasicClass.class)); }