test_class.declarator: KEY_FIELD = "specialValue"
test_class.modifier: private static final
test_class.original_string: private static final String KEY_FIELD = "specialValue";
test_class.type: String
test_class.var_name: KEY_FIELD
test_class.declarator: LIST_SIZE = 5
test_class.modifier: private static final
test_class.original_string: private static final int LIST_SIZE = 5;
test_class.type: int
test_class.var_name: LIST_SIZE
test_class.declarator: util = new ListUtils<String>()
test_class.modifier: private
test_class.original_string: private ListUtils<String> util = new ListUtils<String>();
test_class.type: ListUtils<String>
test_class.var_name: util
test_class.declarator: logger = Logger.getLogger(ListUtilsTest.class)
test_class.modifier: private static
test_class.original_string: private static Logger logger = Logger.getLogger(ListUtilsTest.class);
test_class.type: Logger
test_class.var_name: logger
test_class.file: cmsdal/src/test/java/com/oneops/cms/util/ListUtilsTest.java
test_class.identifier: ListUtilsTest
test_case.body: @Test
  	/**create a list of our MyBean class and validate the util method creates an accurate map
  	 where the key is the specialValue and the object is the bean itself*/
  	public void testList1() throws NoSuchMethodException, InvocationTargetException, IllegalAccessException {
  
  		List<MyBean> listOfBeans = new ArrayList<MyBean>(LIST_SIZE);
  		for (int i = 1; i <= LIST_SIZE; i++) {
  			MyBean m = new MyBean(String.valueOf(i));
  			listOfBeans.add(m);
  		}
  
  		Map<String, MyBean> outMap = util.toMap(listOfBeans, KEY_FIELD);
  		assertEquals(LIST_SIZE, outMap.size());
  		for(MyBean listMember : listOfBeans){
  			assertEquals(listMember, outMap.get(listMember.getSpecialValue()));
  		}
  		System.out.println(outMap);
  
  	}
test_case.class_method_signature: ListUtilsTest.testList1()
test_case.full_signature: @Test /**create a list of our MyBean class and validate the util method creates an accurate map where the key is the specialValue and the object is the bean itself*/ public void testList1()
test_case.identifier: testList1
test_case.invocations: valueOf add toMap assertEquals size assertEquals get getSpecialValue println
test_case.modifiers: @Test /**create a list of our MyBean class and validate the util method creates an accurate map where the key is the specialValue and the object is the bean itself*/ public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testList1()
focal_class.file: cmsdal/src/main/java/com/oneops/cms/util/ListUtils.java
focal_class.identifier: ListUtils
focal_class.class_method_signature: ListUtils.camelHump(String str)
focal_class.full_signature: private static String camelHump(String str)
focal_class.identifier: camelHump
focal_class.modifiers: private static
focal_class.parameters: (String str)
focal_class.return: String
focal_class.signature: String camelHump(String str)
focal_class.class_method_signature: ListUtils.convertFieldToAccessor(String filed)
focal_class.full_signature: private static String convertFieldToAccessor(String filed)
focal_class.identifier: convertFieldToAccessor
focal_class.modifiers: private static
focal_class.parameters: (String filed)
focal_class.return: String
focal_class.signature: String convertFieldToAccessor(String filed)
focal_class.class_method_signature: ListUtils.toMap(List<V> list, String keyField)
focal_class.full_signature: public Map<K, V> toMap(List<V> list, String keyField)
focal_class.identifier: toMap
focal_class.modifiers: public
focal_class.parameters: (List<V> list, String keyField)
focal_class.return: Map<K, V>
focal_class.signature: Map<K, V> toMap(List<V> list, String keyField)
focal_class.class_method_signature: ListUtils.toMapOfList(List<V> list, String keyField)
focal_class.full_signature: public Map<K, List<V>> toMapOfList(List<V> list, String keyField)
focal_class.identifier: toMapOfList
focal_class.modifiers: public
focal_class.parameters: (List<V> list, String keyField)
focal_class.return: Map<K, List<V>>
focal_class.signature: Map<K, List<V>> toMapOfList(List<V> list, String keyField)
focal_method.body: public <V> Map<K, V> toMap(List<V> list, String keyField) throws NoSuchMethodException, InvocationTargetException, IllegalAccessException {
          String accessor = convertFieldToAccessor(keyField);
          Map<K, V> map = new HashMap<K, V>();
          for(V obj : list) {
              Method method = obj.getClass().getMethod(accessor);
              @SuppressWarnings("unchecked")
  			K key = (K)method.invoke(obj);
              map.put(key, obj);
          }
          return map;
      }
focal_method.class_method_signature: ListUtils.toMap(List<V> list, String keyField)
focal_method.full_signature: public Map<K, V> toMap(List<V> list, String keyField)
focal_method.identifier: toMap
focal_method.invocations: convertFieldToAccessor getMethod getClass invoke put
focal_method.modifiers: public
focal_method.parameters: (List<V> list, String keyField)
focal_method.return: Map<K, V>
focal_method.signature: Map<K, V> toMap(List<V> list, String keyField)