* Guice modules, so I ended up pasting in a bunch of code and banging
* it around until it worked. Fun, neh?
*/
private Map<Key<?>, Object> getBindings(HibernateModule module) {
final Map<Key<?>, Object> bindings = Maps.newLinkedHashMap();
final RecordingBinder binder = new RecordingBinder(Stage.PRODUCTION);
module.configure(binder);
for (Element element : binder.getElements()) {
if (element instanceof InstanceBindingImpl<?>) {
final InstanceBindingImpl<?> binding = (InstanceBindingImpl<?>) element;
bindings.put(binding.getKey(), binding.getInstance());
} else if (element instanceof ProviderInstanceBindingImpl<?>) {
final ProviderInstanceBindingImpl<?> binding = (ProviderInstanceBindingImpl<?>) element;