### Question:
InstanceBucket { @NotNull T getSingleInstance() { if (instance instanceof InjectedInstance) { return ((InjectedInstance<T>) instance).object; } else if (instance instanceof BoundInstance) { return ((BoundInstance<T>) instance).object; } MultiObjectInstance multiObjectInstance = (MultiObjectInstance) instance; throw new IllegalStateException( String.format( "Single instance requested, while many instances are stored: %s", multiObjectInstance.instances ) ); } InstanceBucket(
        @NotNull MagnetScope scope,
        @Nullable InstanceFactory<T> factory,
        @NotNull Class<T> objectType,
        @NotNull T object,
        @NotNull String classifier,
        @NotNull OnInstanceListener listener
    ); boolean accept(Visitor visitor);  }### Answer:
@Test @SuppressWarnings("unchecked") public void test_getSingleInstance() { InstanceBucket<Interface1> instances = new InstanceBucket( scope, factory1, Interface1.class, instance1, Classifier.NONE, listener ); Interface1 result = instances.getSingleInstance(); assertThat(result).isSameAs(instance1); }