### Question:
VObjectFactoryMock extends RecordFactoryMock<VObject, VObjectMock> implements VObjectFactory { public List<VObject> searchObjects(String inName, Set<HARDWARE> inHardwares, String inCity, String inCountry, int skip, int count) { final SortedSet<VObject> theResult = new TreeSet<VObject>(new Comparator<VObject>() { public int compare(VObject o1, VObject o2) { return o1.getProfile().getLabel().compareTo(o2.getProfile().getLabel()); } }); for (final VObject anObject : findAll()) { if (!anObject.getPreferences().isVisible()) { continue; } if ((inName != null) && !anObject.getProfile().getLabel().startsWith(inName)) { continue; } if ((inHardwares != null) && !inHardwares.contains(anObject.getHardware())) { continue; } if ((inCity != null) && !anObject.getOwner().getAnnu().getAnnu_city().equals(inCity)) { continue; } if ((inCountry != null) && !anObject.getOwner().getAnnu().getAnnu_country().equals(inCountry)) { continue; } theResult.add(anObject); } return getSkipList(new LinkedList<VObject>(theResult), skip, count); } VObjectFactoryMock(); VObject findByName(String inName); List<VObject> findByOwner(User inUser); VObject findByOwnerAndHardware(User inUser, HARDWARE inHardware); VObject findRandomObject(); VObject findByJID(String inJID); VObject findBySerial(String inSerial); List<VObject> findLastCreatedByHardwares(int count, Set<HARDWARE> hardwares); List<VObject> searchObjects(String inName, Set<HARDWARE> inHardwares, String inCity, String inCountry, int skip, int count); ObjectProfile createObjectProfile(VObject inObject); ObjectPreferences createObjectPreferences(VObject inObject, Lang inLang); ObjectPreferences createObjectPreferences(VObject inObject, Lang inLang, boolean inVisibility); VObject findByNameAndMD5Password(String inName, String inPassword); VObject createObject(HARDWARE inHardware, String inSerial, String inName, String inLabel, User inUser, String inLocation, int inMode, int inState, Files inPicture); int walkObjectsStatus(RecordWalker<VObject> inWalker, Timezone inTimezone, boolean postStateActif);  }### Answer:
@Test public void searchUsersTest() { final Lang frLang = Factories.LANG.findByIsoCode("fr"); final CCalendar theCal = new CCalendar(true); final UserMock myUser = new UserMock(1, "userski", "passmot", "email1@emails.eu", frLang, "FR", "firstName1", "lastName1", getParisTimezone(), "H", "Zip", "Paris", 1); theCal.set(1980, 05, 12); myUser.getAnnu().setDateBirth(new java.sql.Date(theCal.getTimeInMillis())); final VObject theObject = new VObjectMock(61009, "F00004000001", "ObjFacMoTe", myUser, HARDWARE.V2, Factories.TIMEZONE.findByJavaId("Europe/Paris"), frLang); theObject.getPreferences().setPreferences(true, true, null); final List<VObject> theObjects = Factories.VOBJECT.searchObjects(null, null, null, "FR", 0, 10); Assert.assertNotNull(theObjects); Assert.assertEquals(1, theObjects.size()); Assert.assertEquals(theObject, theObjects.get(0)); theObject.getPreferences().setPreferences(false, true, null); final List<VObject> theObjects1 = Factories.VOBJECT.searchObjects(null, null, null, "FR", 0, 10); Assert.assertNotNull(theObjects1); Assert.assertTrue(theObjects1.isEmpty()); }