getステートメントにタイプミスがあり、test1.get(key)であると想定しています。もしそうなら、そもそもマップに正しい型を入れていない限り、なぜそれがArrayListを返さないのかわかりません。
これは機能するはずです:
// populate the map
Map<String, List<String>> test1 = new LinkedHashMap<String, List<String>>();
test1.put("key1", new ArrayList<String>());
test1.put("key2", new ArrayList<String>());
// loop over the set using an entry set
for( Map.Entry<String,List<String>> entry : test1.entrySet()){
String key = entry.getKey();
List<String>value = entry.getValue();
// ...
}
またはあなたが使用することができます
// second alternative - loop over the keys and get the value per key
for( String key : test1.keySet() ){
List<String>value = test1.get(key);
// ...
}
実装を使用して定義する特別な理由がない限り、変数を宣言するとき(および汎用パラメーターで)はインターフェース名を使用する必要があります。