/**
  * @author Bogdan Sliptsov
  *     <p>This method is used to find all groups within a radius of 1000 meters.
  * @param latitude Latitude of requested device
  * @param longitude Longitude of requested device
  * @return Null 1. If latitude or longitude is null; 2. If there are no groups wihin radius of 1
  *     km List of groups within radius of 1 km.
  */
 public List<Group> getAllGroupsByGPS(Double latitude, Double longitude) {
   if (latitude == null || longitude == null) return null;
   List<Group> groups = getAllGroups();
   List<Group> resultList = new ArrayList<>();
   for (Group g : groups) {
     System.out.println(distanceGPS(latitude, longitude, g.getLatitude(), g.getLongitude()));
     if (distanceGPS(latitude, longitude, g.getLatitude(), g.getLongitude()) <= 1.0) {
       resultList.add(g);
     }
   }
   if (resultList.isEmpty()) return null;
   return resultList;
 }