public static ArrayList<String> getFriendsWithSameField(final String uuid, String field) throws userException {
        try {
            ArrayList<String> friends = new ArrayList<String>();

            Callable allfriendsCallable = new Callable() {

                @Override
                public Object call() throws userException {
                    friends friends = new friends(uuid);
                    return friends.getAllFriends();
                }
            };

            Callable fetchUserCallable = new Callable() {

                @Override
                public Object call() throws userException {
                    user me = new user(uuid);
                    me.fetchEntity();
                    return me;
                }
            };

            ExecutorService executor = Executors.newFixedThreadPool(2);
            ArrayList<Callable<Object>> list = new ArrayList<Callable<Object>>();
            list.add(allfriendsCallable);
            list.add(fetchUserCallable);

            ArrayList<Future<Object>> futureList = new ArrayList<Future<Object>>();
            futureList = (ArrayList<Future<Object>>) executor.invokeAll(list);

            ArrayList<String> myFriends = (ArrayList<String>) futureList.get(0).get();
            user me = (user) futureList.get(1).get();
            ArrayList<user> friendsDetails = multipleObjectsHandler.getUsers(myFriends);
            if ("education".equals(field)) {
                String myEdu = ((basicEducationData) (me.getEducationUserdata().get(0))).getName();
                for (user friend : friendsDetails) {
                    String eduId = ((basicEducationData) (me.getEducationUserdata().get(0))).getName();
                    if (eduId.equals(myEdu)) {
                        friends.add(eduId);
                    }
                }
            } else if ("company".equals(field)) {
                String myCompany = ((basicUserData) (me.getEducationUserdata().get(0))).getName();
                for (user friend : friendsDetails) {
                    String compId = ((basicUserData) (me.getEducationUserdata().get(0))).getName();
                    if (compId.equals(myCompany)) {
                        friends.add(compId);
                    }
                }
            }
            return friends;
        } catch (ExecutionException ex) {
            throw new userException("some exception occured while excuting in thread:" + ex.getMessage());
        } catch (InterruptedException ex) {
            throw new userException("some exception occured while excuting in thread:" + ex.getMessage());
        }
    }