The countries that gained EU membership in 2004 are Cyprus , the Czech Republic , Estonia , Hungary , Latvia , Lithuania , Malta , Poland , Slovakia and Slovenia .