@@ -0,0 +1,2846 @@
+package org.coner.util.merger;%0A%0Aimport java.lang.reflect.Method;%0Aimport java.util.Set;%0Aimport org.junit.*;%0A%0Aimport static org.assertj.core.api.Assertions.assertThat;%0A%0Apublic class JavaBeanClassInspectorTest %7B%0A%0A    private JavaBeanClassInspector javaBeanClassInspector;%0A%0A    @Before%0A    public void setup() %7B%0A        javaBeanClassInspector = new JavaBeanClassInspector(TestJavaBeanEntity.class);%0A    %7D%0A%0A    @Test%0A    public void itShouldGetFieldNamesWithDirectAccessors() %7B%0A        Set%3CString%3E actual = javaBeanClassInspector.getFieldNamesWithDirectAccessors();%0A%0A        assertThat(actual)%0A                .hasSize(3)%0A                .contains(%22id%22, %22name%22, %22cool%22);%0A    %7D%0A%0A    @Test%0A    public void itShouldGetDirectAccessorByFieldName() throws NoSuchMethodException %7B%0A        Method actual = javaBeanClassInspector.getDirectAccessorByFieldName(%22name%22);%0A%0A        assertThat(actual)%0A                .isNotNull()%0A                .isEqualTo(TestJavaBeanEntity.class.getMethod(%22getName%22));%0A    %7D%0A%0A    @Test%0A    public void itShouldGetDirectMutatorByFieldName() throws NoSuchMethodException %7B%0A        Method actual = javaBeanClassInspector.getDirectMutatorByFieldName(%22name%22);%0A%0A        assertThat(actual)%0A                .isNotNull()%0A                .isEqualTo(TestJavaBeanEntity.class.getMethod(%22setName%22, String.class));%0A    %7D%0A%0A    @Test%0A    public void whenItHasFieldWithDirectMutatorItShouldReturnTrue() %7B%0A        boolean actual = javaBeanClassInspector.hasFieldWithDirectMutator(%22name%22);%0A%0A        assertThat(actual).isTrue();%0A    %7D%0A%0A    @Test%0A    public void whenItDoesntHaveFieldNameWithDirectMutatorItShouldReturnFalse() %7B%0A        boolean actual = javaBeanClassInspector.hasFieldWithDirectMutator(%22entityInfo%22);%0A%0A        assertThat(actual).isFalse();%0A    %7D%0A%0A    static class TestJavaBeanEntity %7B%0A        private int id;%0A        private String name;%0A        private boolean cool;%0A%0A        public int getId() %7B%0A            return id;%0A        %7D%0A%0A        public void setId(int id) %7B%0A            this.id = id;%0A        %7D%0A%0A        public String getName() %7B%0A            return name;%0A        %7D%0A%0A        public void setName(String name) %7B%0A            this.name = name;%0A        %7D%0A%0A        public boolean isCool() %7B%0A            return cool;%0A        %7D%0A%0A        public void setCool(boolean cool) %7B%0A            this.cool = cool;%0A        %7D%0A%0A        // a method which isn't a javabean accessor/mutator%0A        @Override%0A        public String toString() %7B%0A            return %22SomeSortOfEntity%7B%22 +%0A                    %22id=%22 + id +%0A                    %22, name='%22 + name + '%5C'' +%0A                    '%7D';%0A        %7D%0A%0A        // an indirect accessor%0A        public String getEntityInfo() %7B%0A            return name;%0A        %7D%0A%0A        // an indirect mutator%0A        public void setEntityInfo(String entityInfo) %7B%0A            this.name = entityInfo;%0A        %7D%0A    %7D%0A%0A%7D%0A

Add test for JavaBeanClassInspector