Question: Below is code

```
given().
        get("http://services.groupkt.com/country/get/all").        
then().
      body("RestResponse.result.name", hasItems("Austria","Algeria")).log().all();

```

hasItems() is not recognized by IDE, showing as can't resolve method hasItems()

Maven dependecies exist: Rest assured, groovy, hamcrest.

please help me.

Answer: 
**Union Types**

You can use a [union type](https://www.typescriptlang.org/docs/handbook/2/everyday-types.html#union-types) when declaring variables.

```
let month: string | number = currentTime.getMonth();

if (month < 10) {
  month = '0' + month;
}

```

**Template literals** (ES6+)

Alternatively you can create a new variable and use a [template literal](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals)

```
const paddedMonth: string = `0${month}`;

```

Your string concatenation then turns into this for example:

```
str = `${year}-${paddedMonth}-${day} ${hours}:${minutes}:${seconds} `;

```

Much more readable, IMO.
if you want to work with date, you can use momentjs module:
<https://momentjs.com>

```
moment().format('MMMM Do YYYY, h:mm:ss a'); // July 13th 2017, 11:18:05 pm
moment().format('dddd');                    // Thursday
moment().format("MMM Do YY");               // Jul 13th 17
moment().format('YYYY [escaped] YYYY');     // 2017 escaped 2017
moment().format();                          // 2017-07-13T23:18:05+04:30

```

and about the error you got,you most use like this:

```
 let monthStr: string = month;
 if ( month < 10) {
     monthStr = '0' + month;
 }

```