### Question:
MusicStyleFactoryImpl extends RecordFactoryImpl<MusicStyle, MusicStyleImpl> implements MusicStyleFactory { public List<MusicStyle> findAllStylesByType(long type) { final String[] inJoinTables = new String[] { "music" }; final String condition = "musicstyle_id = music_styleid AND music_lang= 1 AND music_type = ? AND style_private=0 group by musicstyle_id"; final List<MusicStyle> theResult = new ArrayList<MusicStyle>(); theResult.addAll(findAll(inJoinTables, condition, Collections.singletonList((Object) type), "musicstyle_id")); return theResult; } MusicStyleFactoryImpl(); List<MusicStyle> findAllStylesByType(long type); List<MusicStyle> findAllClinByLang(long inLangId); MusicStyle findStyleByName(String categoryName);  }### Answer:
@Test public void findAllStylesByTypeTest() { List<MusicStyle> Categories = Factories.MUSIC_STYLE.findAllStylesByType(Music.TYPE_MP3_USER_LIBRARY); Assert.assertEquals(1, Categories.size()); Assert.assertEquals(4, Categories.get(0).getMusicstyle_id()); Assert.assertEquals("mp3 signature", Categories.get(0).getMusicstyle_name()); Categories = Factories.MUSIC_STYLE.findAllStylesByType(Music.TYPE_MP3_LIBRARY); Assert.assertEquals(1, Categories.size()); Assert.assertEquals(29, Categories.get(0).getMusicstyle_id()); Assert.assertEquals("mp3 perso", Categories.get(0).getMusicstyle_name()); Categories = Factories.MUSIC_STYLE.findAllStylesByType(Music.TYPE_MP3_LITTLE_WORDS); Assert.assertEquals(3, Categories.size()); final List<String> namesCat = new ArrayList<String>(); for (final MusicStyle inMusicStyle : Categories) { namesCat.add(inMusicStyle.getMusicstyle_name()); } Assert.assertTrue(namesCat.contains("reveil")); Assert.assertTrue(namesCat.contains("tts perso")); Assert.assertTrue(namesCat.contains("clin bonjour")); }