class UserCacheImpl implements UserCache {

    @Override
    public synchronized void get(int userId, UserCacheCallback callback) {
        File userEntitiyFile = this.buildFile(userId);
        String fileContent = this.fileManager.readFileContent(userEntitiyFile);
        UserEntity userEntity = this.serializer.deserialize(fileContent);

        if (userEntity != null) {
            callback.onUserEntityLoaded(userEntity);
        } else {
            callback.onError(new UserNotFoundException());
        }
    }

}