class DefaultTransactionManagerLookup implements TransactionManagerLookup {

    @Override
    public TransactionManager getTransactionManager() {
        return Stream.of(getTransactionManagerSuppliers())
                     .map(Supplier::get)
                     .filter(Optional::isPresent)
                     .map(Optional::get)
                     .peek((transactionManager) ->
                                   LOGGER.debug("Found tx manager '{0}'", transactionManager.getClass().getName()))
                     .findFirst()
                     .orElseGet(() -> {
                         LOGGER.debug(JcrI18n.warnNoTxManagerFound.text());
                         return new LocalTransactionManager();
                     });
    }

}