Question: I have a date picker where I can select a date range like 3months, 7 days or this year.
How can I select "This year" from a drop down menu?

Here is the code:

```
 <div class="full">
   <div class="range-preset">
    <div class="date-range-selector">
    <label>Date Range:</label>
    <select class="full" style="width:230px; ">
    <option value="custom">Custom</option>
    <option value="yesterday">Yesterday</option>
    <option value="7days">7 Days</option>
    <option value="30days">30 Days</option>
    <option value="90days">90 Days</option>
    <option value="this_month">This Month</option>
    <option value="last_month">Last Month</option>
    <option value="two_months_ago">Two Months Ago</option>
    <option value="this_year">This Year</option>
    <option value="yesterday">Yesterday</option>
    </select>
   </div>
  </div>

```

I tried this:

```
driver.findElement(By.className("full.option.this_year")).click();

```

Any help please, thank you

Answer: 
Spring does not use the Prototype Pattern, it uses reflection. 
Plus, in order to use clone() it would have to subclass somehow a bean, because clone() is protected, so it does not use clone() either. 

Here is a code fragment from 

```
org.springframework.beans.factory.support.SimpleInstantiationStrategy

```

where you can see the use of java.lang.reflect.Constructor and java.lang.Class reflection method:

```
public Object instantiate(RootBeanDefinition beanDefinition, String beanName, BeanFactory owner) {

    if (beanDefinition.getMethodOverrides().isEmpty()) {
        Constructor<?> constructorToUse;
        synchronized (beanDefinition.constructorArgumentLock) {
            constructorToUse = (Constructor<?>) beanDefinition.resolvedConstructorOrFactoryMethod;
                    ...
                        constructorToUse =  clazz.getDeclaredConstructor((Class[]) null);
                    ...
                }
                ...

    }
    ...
}

```

So the term prototype is used to suggest that at every call to getBean, you'll get a new instance with the same properties. This is more than a simple call to a constructor however, because you'll get a bean with all dependencies wired and other properties set, so in a sense it is a prototype. Or at least it fits the concept very well.
I have not dug into Spring source code, but I think Beans with `prototype` scope in Spring are not created using `clone()` method because it is not mandatory to implement the `Cloneable` interface for those beans.

Moreover, suppose it is creating them using `clone()`. It would then be dangerous if someone is expecting deep copy instead of shallow copy.

You can always test it and find the answer.