package com.jinject;

import org.junit.Assert;

import com.jinject.bind.api.IBinder;
import com.jinject.bind.exception.BindingResolverException;
import com.jinject.bind.impl.Binder;
import com.jinject.bind.model.Controller;
import com.jinject.bind.model.IModel;
import com.jinject.bind.model.IOther;
import com.jinject.bind.model.Model;
import com.jinject.bind.model.Other;
import com.jinject.inject.api.IInjector;
import com.jinject.inject.impl.InjectionBinder;
import com.jinject.inject.impl.Injector;

public class Main {

	public static void main(String[] args) throws InstantiationException, IllegalArgumentException, IllegalAccessException, BindingResolverException {
		
		IInjector injector = new Injector();
		InjectionBinder injectionBinder = new InjectionBinder(injector);
		
		injectionBinder.bind(IOther.class).to(Other.class);
		injectionBinder.bind(IModel.class).to(Model.class);
		
		Model clazz = (Model) injectionBinder.getInstance(IModel.class);
		
		Assert.assertEquals(clazz.getValue(), 0);
		
		
		// ********
		//IInjector injector = new Injector();
		/*
		InjectionBinder injectionBinder = new InjectionBinder(injector);

		Other other = new Other();
		other.setValue(999);
		
		Model model = new Model();
		model.setValue(155);
		
		Model model2 = new Model();
		model2.setValue(285);
		
		injectionBinder.bind(IOther.class).to(Other.class);
		injectionBinder.bind(IModel.class).to(Model.class);

		Controller control = new Controller();
		Controller control2 = new Controller();
		
		injector.inject(control, injectionBinder);
		injector.inject(control2);

		System.out.println("**********************************************************");
		System.out.println(control.model.getOther());
		System.out.println(control2.model.getOther());
		System.out.println(control.model.getOther().equals(control2.model.getOther()));
		*/
	}
}

@@ -26,201 +26,59 @@
 ort 
-org.junit.Assert;%0A%0Aimport com.jinject.bind.api.IBinder;%0Aimport com.jinject.bind.exception.BindingResolverException;%0Aimport com.jinject.bind.impl.Binder;%0Aimport com.jinject.bind.model.Controller
+com.jinject.bind.exception.BindingResolverException
 ;%0Aim
@@ -525,19 +525,16 @@
 ption %7B%0A
-%09%09%0A
 %09%09IInjec
@@ -741,24 +741,24 @@
 .class);%0A%09%09%0A
+
 %09%09Model claz
@@ -816,894 +816,8 @@
 s);%0A
-%09%09%0A%09%09Assert.assertEquals(clazz.getValue(), 0);%0A%09%09%0A%09%09%0A%09%09// ********%0A%09%09//IInjector injector = new Injector();%0A%09%09/*%0A%09%09InjectionBinder injectionBinder = new InjectionBinder(injector);%0A%0A%09%09Other other = new Other();%0A%09%09other.setValue(999);%0A%09%09%0A%09%09Model model = new Model();%0A%09%09model.setValue(155);%0A%09%09%0A%09%09Model model2 = new Model();%0A%09%09model2.setValue(285);%0A%09%09%0A%09%09injectionBinder.bind(IOther.class).to(Other.class);%0A%09%09injectionBinder.bind(IModel.class).to(Model.class);%0A%0A%09%09Controller control = new Controller();%0A%09%09Controller control2 = new Controller();%0A%09%09%0A%09%09injector.inject(control, injectionBinder);%0A%09%09injector.inject(control2);%0A%0A%09%09System.out.println(%22**********************************************************%22);%0A%09%09System.out.println(control.model.getOther());%0A%09%09System.out.println(control2.model.getOther());%0A%09%09System.out.println(control.model.getOther().equals(control2.model.getOther()));%0A%09%09*/%0A
 %09%7D%0A%7D

Clean up main