public void sample() throws ParseException {
//read response
Response response = client().path("cardex").path("changes").get();
Assert.assertNotNull(response);
Assert.assertTrue(response.getStatus() == 200);
//read response as a set
Set<CardexDBTO> jsonResponse = new HashSet<>();
jsonResponse = response.readEntity(new GenericType<Set<CardexDBTO>>() {
});
//create a set same as the (test)object received
Set<CardexDBTO> collect = new HashSet<>();
CardexDBTO cardexResponse = null;
cardexResponse = new CardexDBTO();
cardexResponse.setNombre("Mario");
cardexResponse.setEmail("mario@rossi.it");
collect.add(cardexResponse);
//iterate and test
for (CardexDBTO it : collect) {
for (CardexDBTO it1 : jsonResponse) {
Assert.assertEquals(it.getNombre(), it1.getNombre());

}
}
}