The men were arrested in May and June as part of an investigation into Somalia-linked terrorism activities in the Nordic country .