Repository: j-easy/easy-random
Issue: Instantiate Abstract Class 

when i want to instantiate abstract class, instance of EnhancedRandom will create an object of concrete type but only fill properties of child class. if i put this abstract class in another class instance of container class will have object of concrete type of abstract class and all of properties is filled. i don't know it is a feature or bug. if it is feature  just properties of object in container class should be filled which belong to child class. just like instantiating an abstract class with EnhancedRandom. 
here is example:

```
abstract public class Vehicle {
    private int productionYear;

    public int getProductionYear() {
        return productionYear;
    }

    public void setProductionYear(int productionYear) {
        this.productionYear = productionYear;
    }
}

public class Car extends Vehicle {
    private long topSpeed;

    public long getTopSpeed() {
        return topSpeed;
    }

    public void setTopSpeed(long topSpeed) {
        this.topSpeed = topSpeed;
    }
}

public class Parking {
    private Vehicle vehicle;

    public Vehicle getVehicle() {
        return vehicle;
    }

    public void setVehicle(Vehicle vehicle) {
        this.vehicle = vehicle;
    }
}

 @Test
    public void test() {
        Car car1 = dummyCreator.nextObject(Car.class);
        Vehicle vehicle1 = dummyCreator.nextObject(Vehicle.class);
        Parking parking = dummyCreator.nextObject(Parking.class);
        Vehicle vehicle2 = parking.getVehicle();



    }
```


Changed files:
random-beans/src/test/java/io/github/benas/randombeans/EnhancedRandomImplTest.java
random-beans/src/main/java/io/github/benas/randombeans/EnhancedRandomImpl.java
random-beans/src/test/java/io/github/benas/randombeans/beans/Bar.java

diff --git a/random-beans/src/main/java/io/github/benas/randombeans/EnhancedRandomImpl.java b/random-beans/src/main/java/io/github/benas/randombeans/EnhancedRandomImpl.java
index 972a947c..793003ed 100644
--- a/random-beans/src/main/java/io/github/benas/randombeans/EnhancedRandomImpl.java
+++ b/random-beans/src/main/java/io/github/benas/randombeans/EnhancedRandomImpl.java
@@ -117,7 +117,8 @@ class EnhancedRandomImpl extends EnhancedRandom {
 
             // retrieve declared and inherited fields
             List<Field> fields = getDeclaredFields(result);
-            fields.addAll(getInheritedFields(type));
+            // we can not use type here, because with classpath scanning enabled the result can be a subtype
+            fields.addAll(getInheritedFields(result.getClass()));
 
             // populate fields with random data
             populateFields(fields, result, context);
diff --git a/random-beans/src/test/java/io/github/benas/randombeans/EnhancedRandomImplTest.java b/random-beans/src/test/java/io/github/benas/randombeans/EnhancedRandomImplTest.java
index cb969295..f1c44102 100644
--- a/random-beans/src/test/java/io/github/benas/randombeans/EnhancedRandomImplTest.java
+++ b/random-beans/src/test/java/io/github/benas/randombeans/EnhancedRandomImplTest.java
@@ -227,7 +227,22 @@ public class EnhancedRandomImplTest {
     }
 
     @Test
-    public void whenScanClasspathForConcreteTypesIsEnabled_thenShouldPopulateConcreteSubTypes() {
+    public void whenScanClasspathForConcreteTypesIsEnabled_thenShouldPopulateAbstractTypesWithConcreteSubTypes() {
+        // Given
+        enhancedRandom = EnhancedRandomBuilder.aNewEnhancedRandomBuilder().scanClasspathForConcreteTypes(true).build();
+
+        // When
+        Bar bar = enhancedRandom.nextObject(Bar.class);
+
+        // Then
+        assertThat(bar).isNotNull();
+        assertThat(bar).isInstanceOf(ConcreteBar.class);
+        // https://github.com/benas/random-beans/issues/204
+        assertThat(bar.getI()).isNotNull(); 
+    }
+
+    @Test
+    public void whenScanClasspathForConcreteTypesIsEnabled_thenShouldPopulateFieldsOfAbstractTypeWithConcreteSubTypes() {
         // Given
         enhancedRandom = EnhancedRandomBuilder.aNewEnhancedRandomBuilder().scanClasspathForConcreteTypes(true).build();
 
diff --git a/random-beans/src/test/java/io/github/benas/randombeans/beans/Bar.java b/random-beans/src/test/java/io/github/benas/randombeans/beans/Bar.java
index 3254c663..0208be21 100644
--- a/random-beans/src/test/java/io/github/benas/randombeans/beans/Bar.java
+++ b/random-beans/src/test/java/io/github/benas/randombeans/beans/Bar.java
@@ -23,7 +23,12 @@
  */
 package io.github.benas.randombeans.beans;
 
+import lombok.Data;
+
+@Data
 public abstract class Bar {
 
+    private Integer i;
+
     public abstract String getName();
 }