private void addToValidPositions(Unit unit, List<Position> validPositions, MovementHelper helper, List<Unit> units) {
      boolean hasDifferentColorUnit = false;
      if (units == null) {
         return;
      }
      for (Unit otherUnit : units) {
         // If the unit has a different color
         if (!unit.getPlayer().equals(otherUnit.getPlayer())) {
            hasDifferentColorUnit = true;
         }
      }
      if (units.isEmpty() || hasDifferentColorUnit) {
         validPositions.add(helper.getPosition());
      }
   }