Buggy code:
@ RequestScoped public abstract class PersistenceKeeperImpl implements PersistenceKeeper , Closeable { private static enum CommitType { SAVE , UPDATE , SAVE_OR_UPDATE , MERGE , PERSIST ; } private static final Logger LOG = LoggerFactory . getLogger ( PersistenceKeeperImpl . class ) ; private static final Validator VALIDATOR = Validation . buildDefaultValidatorFactory ( ) . getValidator ( ) ; private static final ConcurrentHashMap < String , SessionFactory > FACTORIES = new ConcurrentHashMap < String , SessionFactory > ( ) ; private static final Map < Class < ? extends PersistenceKeeper > , String > PATHS = new HashMap < > ( ) ; private static final Map < Class < ? extends PersistenceKeeper > , Class < ? extends AnnotationConfiguration > > CONFIGS = new HashMap < > ( ) ; private static int batchSize = 50 ; protected Session session ; protected StatelessSession statelessSession ; protected AtomicBoolean closed = new AtomicBoolean ( ) ; public PersistenceKeeperImpl ( ) { } @ Override public void close ( ) { } protected static SessionFactory buildSessionFactory ( ) { } protected static SessionFactory buildSessionFactory ( Class < ? extends AnnotationConfiguration > clazz , String path ) { } protected static SessionFactory buildSessionFactory ( AnnotationConfiguration configuration , File file ) { } @ Override public String getSessionFactoryPath ( ) { } public static Class < ? extends AnnotationConfiguration > getHibernateConfigurationClass ( Class < ? extends PersistenceKeeper > clazz ) { Class < ? extends AnnotationConfiguration > cfg = PersistenceKeeperImpl . CONFIGS . get ( clazz ) ; if ( cfg != null ) { <START_BUG> return null ; <END_BUG> } PersistentFactory pf = clazz . getAnnotation ( PersistentFactory . class ) ; if ( pf == null ) { return null ; } return pf . configuration ( ) ; } public static String getSessionFactoryPath ( Class < ? extends PersistenceKeeper > clazz ) { } public static SessionFactory getSessionFactory ( Class < ? extends PersistenceKeeper > clazz ) { } public static SessionFactory getSessionFactory ( Class < ? extends AnnotationConfiguration > clazz , String path ) { } @ Override public SessionFactory getSessionFactory ( ) { } public static int getBatchSize ( ) { } public static void shutdown ( ) { } @ Override public Session session ( ) { } @ Override public StatelessSession stateless ( ) { } private < T > boolean isEntity ( Class < T > c ) { } @ Override public < T extends Identity < ? > > Collection < T > persist ( Collection < T > entities ) { } @ Override public < T extends Identity < ? > > Collection < T > save ( Collection < T > entities ) { } @ Override public < T extends Identity < ? > > Collection < T > saveOrUpdate ( Collection < T > entities ) { } @ Override @ SuppressWarnings ( "unchecked" ) public < T > T get ( Class < T > clazz , Serializable id ) { } @ Override @ SuppressWarnings ( "unchecked" ) public < T extends Identity < ? > > T reget ( T entity ) { } @ Override public < T > T refresh ( T entity ) { } @ Override public < T > int count ( Class < T > clazz ) { } @ Override public < T extends Identity < ? > > boolean exists ( Class < T > clazz , Serializable id ) { } @ Override @ SuppressWarnings ( "unchecked" ) public < T > List < T > list ( Class < T > clazz ) { } @ Override @ SuppressWarnings ( "unchecked" ) public < T > List < T > list ( Class < T > clazz , int pgNum , int pgSize ) { } @ Override public < T extends Identity < ? > > ScrollableResultsIterator < T > cursor ( Class < T > clazz ) { } @ Override public < T extends Identity < ? > > T persist ( T stateless ) { } @ Override public < T extends Identity < ? > > T merge ( T entity ) { } @ Override public < T extends Identity < ? > > T save ( T entity ) { } @ Override public < T extends Identity < ? > > T saveOrUpdate ( T entity ) { } @ Override public < T extends Identity < ? > > T update ( T entity ) { } @ SuppressWarnings ( "unchecked" ) private < T extends Identity < ? > > T store ( T entity , PersistenceKeeperImpl . CommitType type ) { } @ Override public < T extends Identity < ? > > Collection < T > update ( Collection < T > entities ) { } @ Override public < T extends Identity < ? > > Collection < T > merge ( Collection < T > entities ) { } private < T extends Identity < ? > > Collection < T > store ( Collection < T > entities , PersistenceKeeperImpl . CommitType type ) { } @ Override @ SuppressWarnings ( "unchecked" ) public < T extends Identity < ? > > T hydrate ( T dry ) { } @ Override public < T > T hydrate ( T dry , T managed ) { } @ Override public < T extends Identity < ? > > T delete ( T entity ) { } @ Override public < T extends Identity < ? > > Collection < T > delete ( Collection < T > entities ) { } @ Override public < T extends Identity < ? > > boolean delete ( Class < T > clazz , Serializable id ) { } @ Override public < T extends Identity < ? > > T evict ( T entity ) { }

Fix:
return cfg ;