class RepoBranchesMapper implements Func1<List<BranchDTO>, List<Branch>> {

    @Override
    public List<Branch> call(List<BranchDTO> branchDTOs) {
        if (branchDTOs == null) {
            return null;
        }
        List<Branch> branches = Observable.from(branchDTOs)
                .map(branchDTO -> new Branch(branchDTO.getName()))
                .toList()
                .toBlocking()
                .first();
        return branches;
    }

    @Inject public  RepoBranchesMapper();

}