CounterRepository repo = counterRepository;
String myCounterName = "myCounter";
String yourCounterName = "yourCounter";
// Create and save a Counter named 'myCounter'
Counter c1 = new Counter(myCounterName);
Counter myCounter = repo.save(c1);
assertThat(myCounter.getName(), is(notNullValue()));
// Create and save a Counter named 'yourCounter'
Counter c2 = new Counter(yourCounterName);
Counter yourCounter = repo.save(c2);
assertThat(yourCounter.getName(), is(notNullValue()));
assertTrue(repo.exists(yourCounterName));
// Retrieve by name and compare for equality to previously saved instance.
Counter result = repo.findOne(myCounterName);
assertThat(result, equalTo(myCounter));
result = repo.findOne(yourCounter.getName());
assertThat(result, equalTo(yourCounter));