// Path: graceland-platform/src/test/java/io/graceland/testing/TestConfiguration.java
// public class TestConfiguration implements Configuration {
// }
// 
// Path: graceland-platform/src/test/java/io/graceland/testing/TestFileConfiguration.java
// public class TestFileConfiguration implements Configuration {
// 
//     private final int abc;
//     private final String test;
// 
//     @JsonCreator
//     public TestFileConfiguration(
//             @JsonProperty("abc") int abc,
//             @JsonProperty("test") String test) {
// 
//         this.abc = abc;
//         this.test = test;
//     }
// 
//     public int getAbc() {
//         return abc;
//     }
// 
//     public String getTest() {
//         return test;
//     }
// 
//     @Override
//     public boolean equals(Object o) {
//         if (this == o) return true;
//         if (o == null || getClass() != o.getClass()) return false;
// 
//         TestFileConfiguration that = (TestFileConfiguration) o;
// 
//         if (abc != that.abc) return false;
//         if (test != null ? !test.equals(that.test) : that.test != null) return false;
// 
//         return true;
//     }
// 
//     @Override
//     public int hashCode() {
//         int result = abc;
//         result = 31 * result + (test != null ? test.hashCode() : 0);
//         return result;
//     }
// }


import org.junit.Test;
import com.google.inject.AbstractModule;
import com.google.inject.Binder;
import com.google.inject.Guice;
import com.google.inject.Injector;
import com.google.inject.Key;
import io.graceland.testing.TestAnnotation;
import io.graceland.testing.TestConfiguration;
import io.graceland.testing.TestFileConfiguration;
import static org.hamcrest.Matchers.equalTo;
import static org.hamcrest.Matchers.is;
import static org.junit.Assert.assertThat;
import static org.mockito.Mockito.mock;
    }

    @Test
    public void toInstance_binds_an_annotated_instance() {
        final TestConfiguration expectedConfiguration = new TestConfiguration();

        Injector injector = Guice.createInjector(new AbstractModule() {
            @Override
            protected void configure() {
                ConfigurationBinder
                        .forClass(TestConfiguration.class, binder())
                        .annotatedWith(TestAnnotation.class).toInstance(expectedConfiguration);
            }
        });

        assertThat(
                injector.getInstance(Key.get(TestConfiguration.class, TestAnnotation.class)),
                is(expectedConfiguration));
    }

    @Test(expected = NullPointerException.class)
    public void toFile_cannot_bind_null() {
        ConfigurationBinder
                .forClass(TestConfiguration.class, mock(Binder.class))
                .toFile(null);
    }

    @Test(expected = IllegalArgumentException.class)
    public void toFile_file_must_exist() {
        ConfigurationBinder
// Path: graceland-platform/src/test/java/io/graceland/testing/TestConfiguration.java
// public class TestConfiguration implements Configuration {
// }
// 
// Path: graceland-platform/src/test/java/io/graceland/testing/TestFileConfiguration.java
// public class TestFileConfiguration implements Configuration {
// 
//     private final int abc;
//     private final String test;
// 
//     @JsonCreator
//     public TestFileConfiguration(
//             @JsonProperty("abc") int abc,
//             @JsonProperty("test") String test) {
// 
//         this.abc = abc;
//         this.test = test;
//     }
// 
//     public int getAbc() {
//         return abc;
//     }
// 
//     public String getTest() {
//         return test;
//     }
// 
//     @Override
//     public boolean equals(Object o) {
//         if (this == o) return true;
//         if (o == null || getClass() != o.getClass()) return false;
// 
//         TestFileConfiguration that = (TestFileConfiguration) o;
// 
//         if (abc != that.abc) return false;
//         if (test != null ? !test.equals(that.test) : that.test != null) return false;
// 
//         return true;
//     }
// 
//     @Override
//     public int hashCode() {
//         int result = abc;
//         result = 31 * result + (test != null ? test.hashCode() : 0);
//         return result;
//     }
// }


// Path: graceland-platform/src/test/java/io/graceland/configuration/ConfigurationBinderTest.java
import org.junit.Test;
import com.google.inject.AbstractModule;
import com.google.inject.Binder;
import com.google.inject.Guice;
import com.google.inject.Injector;
import com.google.inject.Key;
import io.graceland.testing.TestAnnotation;
import io.graceland.testing.TestConfiguration;
import io.graceland.testing.TestFileConfiguration;
import static org.hamcrest.Matchers.equalTo;
import static org.hamcrest.Matchers.is;
import static org.junit.Assert.assertThat;
import static org.mockito.Mockito.mock;

    }

    @Test
    public void toInstance_binds_an_annotated_instance() {
        final TestConfiguration expectedConfiguration = new TestConfiguration();

        Injector injector = Guice.createInjector(new AbstractModule() {
            @Override
            protected void configure() {
                ConfigurationBinder
                        .forClass(TestConfiguration.class, binder())
                        .annotatedWith(TestAnnotation.class).toInstance(expectedConfiguration);
            }
        });

        assertThat(
                injector.getInstance(Key.get(TestConfiguration.class, TestAnnotation.class)),
                is(expectedConfiguration));
    }

    @Test(expected = NullPointerException.class)
    public void toFile_cannot_bind_null() {
        ConfigurationBinder
                .forClass(TestConfiguration.class, mock(Binder.class))
                .toFile(null);
    }

    @Test(expected = IllegalArgumentException.class)
    public void toFile_file_must_exist() {
        ConfigurationBinder
                .forClass(TestFileConfiguration.class, mock(Binder.class))