Add another check
Implement synchronization
Use generic functions to get rid of generic class:
- Nice Java language feature