Skip to content

Instantly share code, notes, and snippets.

@shazin
Created September 10, 2017 05:11
Show Gist options
  • Save shazin/9594355673f74fbc4c9e18302a7ae09c to your computer and use it in GitHub Desktop.
Save shazin/9594355673f74fbc4c9e18302a7ae09c to your computer and use it in GitHub Desktop.
@Service
public class PersonService {
private final List<Person> PEOPLE = new ArrayList<>();
{
PEOPLE.add(new Person("Shazin"));
PEOPLE.add(new Person("Shahim"));
PEOPLE.add(new Person("Shuhail"));
PEOPLE.add(new Person("Shuhaib"));
PEOPLE.add(new Person("Athiyab"));
PEOPLE.add(new Person("Athif"));
}
public List<Person> getPeople() {
try {
Thread.sleep(new Random(System.currentTimeMillis()).nextInt(1000));
} catch (InterruptedException e) {
e.printStackTrace();
}
return Collections.unmodifiableList(PEOPLE);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment