code: @Override
      public DataModelIF<U, I>[] split(final DataModelIF<U, I> data) {
          @SuppressWarnings("unchecked")
          final DataModelIF<U, I>[] splits = new DataModelIF[2];
          splits[0] = DataModelFactory.getDefaultModel(); // training
          splits[1] = DataModelFactory.getDefaultModel(); // test
          if (perUser) {
              for (U user : data.getUsers()) {
                  if (doSplitPerItems) {
                      List<I> items = new ArrayList<>();
                      data.getUserItems(user).forEach(items::add);
                      Collections.shuffle(items, rnd);
                      int splitPoint = Math.round(percentageTraining * items.size());
                      for (int i = 0; i < items.size(); i++) {
                          I item = items.get(i);
                          Double pref = data.getUserItemPreference(user, item);
                          DataModelIF<U, I> datamodel = splits[0]; // training
                          if (i > splitPoint) {
                              datamodel = splits[1]; // test
                          }
                          if (pref != null) {
                              datamodel.addPreference(user, item, pref);
                          }
                      }
                  }
              }
          } else {
              for (U user : data.getUsers()) {
                  for (I item : data.getUserItems(user)) {
                      Double pref = data.getUserItemPreference(user, item);
                      if (doSplitPerItems) {
                          DataModelIF<U, I> datamodel = splits[0]; // training
                          if (rnd.nextDouble() > percentageTraining) {
                              datamodel = splits[1]; // test
                          }
                          if (pref != null) {
                              datamodel.addPreference(user, item, pref);
                          }
                      } else {
                          DataModelIF<U, I> datamodel = splits[0]; // training
                          if (rnd.nextDouble() > percentageTraining) {
                              datamodel = splits[1]; // test
                          }
                          if (pref != null) {
                              datamodel.addPreference(user, item, pref);
                          }
                      }
                  }
              }
          }
          return splits;
      }
docs: {@inheritDoc}