### Question:
BeanMapper { public static <S, D> D map(S source, Class<D> destinationClass) { return mapper.map(source, destinationClass); }  static D map(S source, Class<D> destinationClass); static List<D> mapList(Iterable<S> sourceList, Class<D> destinationClass); static D[] mapArray(final S[] sourceArray, final Class<D> destinationClass);  }### Answer:
@Test public void copySingleObject() { Student student = new Student("zhang3", 20, new Teacher("li4"), ListUtil.newArrayList("chinese", "english")); StudentVO studentVo = BeanMapper.map(student, StudentVO.class); assertThat(studentVo.name).isEqualTo("zhang3"); assertThat(studentVo.getAge()).isEqualTo(20); assertThat(studentVo.getTeacher().getName()).isEqualTo("li4"); assertThat(studentVo.getCourse()).containsExactly("chinese", "english"); }
@Test public void copy2Map() { Teacher teacher = new Teacher("zhang"); Map map = BeanMapper.map(teacher, Map.class); assertThat(map).containsKeys("name").containsValues("zhang"); Student student = new Student("zhang3", 20, new Teacher("li4"), ListUtil.newArrayList("chinese", "english")); Map mapStu = BeanMapper.map(student, Map.class); assertThat(mapStu.containsKey("teacher")); assertThat(mapStu.get("teacher")).hasFieldOrProperty("name"); }