Collection INIT

init java collections in test case

            final Map<String, String> attributes = new HashMap<String, String>() {{
                    put("key1","e1-value");
                    put("key2","e2-value");
                    put("key3","e3-value");
                    put("key4","e4-value");
                    put("key5","e5-value");
            }};

similarly

            Collection<String> columnNames = new ArrayList<String>() {{
                    add("e1");
                    add("e2");
            }};

 

posted on 2014-03-14 08:54  grep  阅读(208)  评论(0编辑  收藏  举报