private void guessCountryName(final JTextField text,final Iterator<Entry<String,Point>> centersiter){
  final List<String> options=new ArrayList<>();
  while (centersiter.hasNext()) {
    final Entry<String,Point> item=centersiter.next();
    final Point p=new Point(item.getValue());
    for (    final Polygon polygon : m_current) {
      if (polygon.contains(p)) {
        options.add(item.getKey());
      }
    }
  }
  if (!options.isEmpty()) {
    Collections.shuffle(options);
    text.setText(options.get(0));
  }
}

private void guessCountryName ( final JTextField text , final Iterator < Entry < String , Point > > centersiter ) { final List < String > options = new ArrayList < > ( ) ; while ( centersiter . hasNext ( ) ) { final Entry < String , Point > item = centersiter . next ( ) ; final Point p = new Point ( item . getValue ( ) ) ; for ( final Polygon polygon : m_current ) { if ( polygon . contains ( p ) ) { options . add ( item . getKey ( ) ) ; } } } if ( ! options . isEmpty ( ) ) { Collections . shuffle ( options ) ; text . setText ( options . get ( 0 ) ) ; } }
guesscountryname ( javax . swing . jtextfield , java . tools . iterator ) guess the country name based on the location of the previous centers
