doing the cast directly would have the same result but would be a bit faster :-) 
FileEntry fe = (FileEntry) o;