### Question:
MusicFactoryImpl extends RecordFactoryImpl<Music, MusicImpl> implements MusicFactory { public List<Music> findAllByUserIdAndType(User inOwner, String ensembleMimeTypes, int skip, int count) { final String condition = "music_owner = ? and music_type in ( " + ensembleMimeTypes + " )"; return findAll(condition, Arrays.asList(new Object[] { inOwner.getId() }), "music_id desc", skip, count); } MusicFactoryImpl(); boolean usesFiles(Files inFile); long countItemsOfUserByMimeType(User inOwner, String ensembleMimeTypes); Music createNewMusic(User theUser, Files inFile); Music createNewMusic(Files inFile, String name, User inOwner, int styleid, int share); Music create(Files inFile, Lang inLang, String name, User inOwner, int styleid, int share, int type); Music findByIdOrUser(long id, User user); Music findNabshareRand(); Music findNabshareRand(Lang inLang); Music findRandomClin(long idCateg, Lang inLang); Music findRandomClin(Lang lang); Music findRandomInBiblio(); Music findByFile(Files inFile); List<Music> findAllForSignature(User inUser); List<Music> findAllByUserIdAndType(User inOwner, String ensembleMimeTypes, int skip, int count); List<Music> findRecentsByType(String ensembleMimeTypes, int count); List<Music> findAllClin(Lang inLang, long idCateg); List<Music> findAllForAlarmClock(Lang inLang); List<Music> findAllForBiblio(int inMusicStyleId); List<Music> findAllNabshareByOwner(User user); List<Music> findAllPersoByUser(User inUser); List<Music> findByStyle(long inMusicStyleId); List<Music> findByTagAndLang(String inTag, Lang inLang); List<Music> findByNabshareCategAndLang(long idNabshareCateg, Lang inLang); List<Music> findByNabshareCategName(String categoryName, int skip, int count); List<Music> findAllStylesByTypeAndLang(long type, Lang inLang, String categoryName, int skip, int count); List<Music> findAllSignatures();  }### Answer:
@Test public void findAllByUserAndMimeTypeTest() { final User theOwner103 = Factories.USER.find(103L); final User theOwner104 = Factories.USER.find(104L); final String all = MimeTypes.all.getMimeType(); final String audio = MimeTypes.audio.getMimeType(); final String images = MimeTypes.images.getMimeType(); Assert.assertEquals(3, Factories.MUSIC.findAllByUserIdAndType(theOwner103, all, 0, 10).size()); Assert.assertEquals(2, Factories.MUSIC.findAllByUserIdAndType(theOwner103, all, 1, 10).size()); Assert.assertEquals(1, Factories.MUSIC.findAllByUserIdAndType(theOwner103, all, 0, 1).size()); Assert.assertEquals(2, Factories.MUSIC.findAllByUserIdAndType(theOwner103, audio, 0, 10).size()); Assert.assertEquals(1, Factories.MUSIC.findAllByUserIdAndType(theOwner104, all, 0, 10).size()); Assert.assertEquals(1, Factories.MUSIC.findAllByUserIdAndType(theOwner104, images, 0, 10).size()); }