I don't see the problem. This method is reading from a file and has no side effect. This is up to the caller to synchronize this method if it is using it to create a side effect (e.g. replacing the set).