Question: is there a way to fetch last three year data from the hive table
my column has a data in this format (2018-07-01 00:00:00.0)
I have to fetch out last three years data

Answer: 
```
List<Double> collect1 = list.stream()
          .mapToDouble(s -> s) // DoubleStream
          .boxed()  // Stream<Double>
          .collect(Collectors.toList());  //collected to List<Double>

```

caution: `boxing()` is overhead.

---

Another way around, without `boxing()`

```
List<Double> listDouble = new ArrayList<>();
list.stream().mapToDouble(s->s).forEach(k->listDouble.add(k));

```
You have to use the mapToDoubleoperator to convert Long into a Double and then use the toList collector.

```
List<Long> longs = new ArrayList<>();
    longs.add(2316354L);
    longs.add(2456354L);
    longs.add(888354L);

    List<Double> doubles = longs.stream().mapToDouble(e->e).boxed().collect(Collectors.toList());

```