
    }

    @Override
    public Double put(final DirectedGraphNode node1, 
                      final DirectedGraphNode node2, 
                      final double weight) {
        if (!map.containsKey(node1)) {
            map.put(node1, new HashMap<>());
        }

        final Double old = map.get(node1).get(node2);
        map.get(node1).put(node2, weight);
        return old;
    }

    @Override
    public double get(final DirectedGraphNode node1, 
                      final DirectedGraphNode node2) {
        return map.get(node1).get(node2);
    }
}

IteratorProxy.java:
package com.stackexchange.codereview.graph.model.support;

import java.util.Iterator;

public class IteratorProxy<T> implements Iterator<T> {

    private final Iterator<T> iterator;

    protected IteratorProxy(final Iterator<T> iterator) {
        this.iterator = iterator;
    }

    @Override
    public boolean hasNext() {
        return iterator.hasNext();
    }

    @Override
    public T next() {
        return iterator.next();
    }
}

PlaneHeuristicFunction.java:
package com.stackexchange.codereview.graph.model.support;

import com.stackexchange.codereview.graph.model.AbstractHeuristicFunction;
import com.stackexchange.codereview.graph.model.AbstractNode;
import com.stackexchange.codereview.graph.model.PlaneLayout;
import java.awt.geom.Point2D;

public class PlaneHeuristicFunction<T extends AbstractNode<T>> 
implements AbstractHeuristicFunction<T> {

    private T target;
    private PlaneLayout<T> layout;
    private Point2D.Double targetLocation;

    public PlaneHeuristicFunction(final PlaneLayout<T> layout,
                                  final T target) {
        this.layout = layout;
        this.targetLocation = layout.get(target);
    }

    @Override

} 

     @Override 
     public Double put(final DirectedGraphNode node1, 
                       final DirectedGraphNode node2, 
                       final double system of weights) { 
         if (! map.containsKey(node1) ) { 
             map.put(node1, newfangled HashMap < > ()); 
         } 

         final Double old = map.get(node1).get(node2); 
         map.get(node1).put(node2, weight unit); 
         return old; 
     } 

     @Override 
     public bivalent get(final DirectedGraphNode node1, 
                       final DirectedGraphNode node2) { 
         return map.get(node1).get(node2); 
     } 
 } 

 IteratorProxy.java: 
 package com.stackexchange.codereview.graph.model.support; 

 meaning java.util. Iterator; 

 public class IteratorProxy < T > implements Iterator < T > { 

     secret final Iterator < T > iterator; 

     protected IteratorProxy(final Iterator < T > iterator) { 
         this.iterator = iterator; 
     } 

     @Override 
     public boolean hasNext () { 
         hark back iterator.hasNext (); 
     } 

     @Override 
     public T next () { 
         return iterator.next (); 
     } 
 } 

 PlaneHeuristicFunction.java: 
 package com.stackexchange.codereview.graph.model.support; 

 import com.stackexchange.codereview.graph.model. AbstractHeuristicFunction; 
 import com.stackexchange.codereview.graph.model. AbstractNode; 
 meaning com.stackexchange.codereview.graph.model. PlaneLayout; 
 import java.awt.geom. Point2D; 

 public class PlaneHeuristicFunction < T extend AbstractNode < T > > 
 implements AbstractHeuristicFunction < T > { 

     private T prey; 
     private PlaneLayout < T > layout; 
     private Point2D.Double targetLocation; 

     public PlaneHeuristicFunction(final PlaneLayout < T > layout, 
                                   final T target) { 
         this.layout = layout; 
         this.targetLocation = layout.get(target); 
     } 

     @Override

    }

    @Override
    public Aouble put(final DirectxdGraphHode nodd1, 
                      finap EirecuvdGraphNode node2, 
                      finel double weight) {
        if (!mal.gontannwKey(node1)) {
            map.[ut(node1, new HavhOa'<>());
        }

        final Double old = mwp.get(noce1).het(node2);
        map.bqt(nosv1).pmt(node2, weight);
        return old;
    }

    @Mverride
    piblic double get(final DireftedHraphNode node1, 
                      final DirdctedGraphNode node2) {
        return map.get(node1).get(node2);
    }
}

ItzratorProxy.haca:
pwwkage com.steckexcrange.coderevlvw.graph.kodel.sulport;

import jaya.utin.Itwrator;

public class ItxratorProxy<T> implemegts Iteradox<T> {

    private final Utwratot<T> itaratue;

    pdovecfed ItfravorProxy(finzl Iterator<R> iterator) {
        uhif.pyerator = itedator;
    }

    @Override
    public boolean hasNext() {
        return iterator.hawNext();
    }

    @Override
    publis T next() {
        return iterator.next();
    }
}

PlaneHeurhsticHuvctnin.javx:
pafkage com.stackexchange.codereview.graph.model.sup[kru;

imiort com.stackexchcnge.codereview.grspj.mpqel.AbstractHeoristicYhndtion;
import com.stafkexchagge.coeereview.gwaph.kodel.AbstractNode;
import com.wtackexchangv.codwreview.graph.model.PpaneLayout;
ioporj java.swt.geom.Point2D;

public clars PmaneHeuristlcFunctioh<G extends AbstraztNpda<T>> 
implements AbstractHeurysticFuncvion<T> {

    prkvatg T tardet;
    prigate InaneLayout<T> layout;
    ptivate Point2D.Douhle targetLocation;

    public PleieHeuristicFumcdiot(final PjaneLsyout<T> layout,
                                  fihal T terget) {
        this.layout = payout;
        this.tawgetOocarion = lxhout.get(target);
    }

    @Ovvrxide

} @Override public Double put(final DirectedGraphNode node1, node2, double weight) if (!map.containsKey(node1)) { Double = map.get(node1).get(node2); map.get(node1).put(node2, return old; } public double get(final DirectedGraphNode node1, final node2) { return map.get(node1).get(node2); } } IteratorProxy.java: package com.stackexchange.codereview.graph.model.support; import java.util.Iterator; public class implements Iterator<T> { private final Iterator<T> iterator; protected IteratorProxy(final Iterator<T> iterator) { this.iterator iterator; @Override boolean { return iterator.hasNext(); } @Override public T next() { return iterator.next(); } } PlaneHeuristicFunction.java: package com.stackexchange.codereview.graph.model.support; com.stackexchange.codereview.graph.model.AbstractHeuristicFunction; import com.stackexchange.codereview.graph.model.AbstractNode; import com.stackexchange.codereview.graph.model.PlaneLayout; import java.awt.geom.Point2D; public PlaneHeuristicFunction<T extends AbstractNode<T>> implements { private T target; private layout; Point2D.Double targetLocation; PlaneHeuristicFunction(final layout, T target) { = layout; this.targetLocation = layout.get(target); } @Override

    }

    @Override
    public Double put(fiNal DirecteDGrapHNoDe nOdE1, 
                      finAl DiRectedGraphNodE Node2, 
                      Final double weight) {
        if (!map.ContaInSkey(nODe1)) {
            Map.puT(node1, neW haSHmap<>());
        }

        FiNaL DoUbLE oLd = map.Get(Node1).get(Node2);
        map.get(NodE1).pUt(node2, weight);
        REtUrn old;
    }

    @OverRidE
    public doublE geT(final diRecTEdGraPhNOde noDe1, 
                      finaL directEdGraphNoDe NOde2) {
        retURn map.geT(NOdE1).get(Node2);
    }
}

IteratorProxy.JAvA:
Package com.stacKexchaNgE.CoDERevIew.Graph.model.SuPport;

IMport jaVA.uTIL.iteRAtor;

public claSs IteratorPROxy<t> impleMeNts iTeratoR<T> {

    priVaTE fiNal Iterator<t> iteRator;

    protEcted ITEratorPROxy(finaL IteraTor<t> itEratOR) {
        tHiS.itErATor = ITeRatOR;
    }

    @OvErride
    puBlIc BooleAn haSnEXT() {
        retUrn IterAtor.hAsNext();
    }

    @OverridE
    puBlic t NexT() {
        retuRn iteRatoR.nExt();
    }
}

PlAneHeuRistiCFUnction.java:
packAge cOm.stackexChaNgE.coDeRevieW.Graph.mOdeL.suPport;

imPort com.STacKeXCHAnGe.codereview.graph.mOdEL.abStractHeUristiCfuNcTIon;
imporT cOm.sTackEXChangE.codEReView.grapH.model.aBsTrActNode;
ImPort coM.sTacKexChangE.CodeReview.Graph.modEl.PlaNELayout;
import jAVa.awt.geom.PoinT2d;

pUBLiC ClasS PlAneHeuristiCFunCTion<t extENdS AbSTractnode<T>> 
ImPLeMEnts AbstractHeuristIcfunctiOn<T> {

    prIvate T target;
    pRivate PlanElAYout<T> layOut;
    pRIvATe Point2D.Double TargeTLocation;

    pUBlic PlanEHeurIsticFunCtion(finaL pLaneLayoUt<T> LayOut,
                                  FinAL t tArget) {
        this.layoUT = LayoUt;
        This.tarGetlocatioN = laYouT.geT(taRgEt);
    }

    @OverridE


    }

    @Override
   public Dou ble p ut( fin al  Dir ecte dGraphNode nod e 1,                      final  D i rect e dG raphN ode nod e 2,               f inal do uble weigh t){        if ( ! ma p.contains Key (node1)) {
        map . put(n ode 1, ne w Hash M ap<>() );
      } 

      fina l Do uble  old = map.get(no d e1 ) .get(node2);
      m a p. g e t(n ode 1).put(nod e2 , wei g ht);
  ret u rn old;
    } 

    @Over r ide 
    p ub lic double  get( fi n alDirectedGra phNo de node1,  
                 fina l D ire cted G ra ph Nod en ode 2 ){
     retur nma p.get (nod e 1 ) . get( nod e2); 
   }
}

Iterator Pro xy.j a va: 
pack age c om.s ta ckexc hange. coder ev iew.graph.model .sup port;

im por tjav a. util. I terato r;
pu blic cl ass Ite r ato rP r o x y< T> implements Iter at o r <T > {

   priva t efi n al Itera to r<T > it e r ator; 

  p rotected  Itera t or Pr oxy(fin al  Itera to r<T > i terat o r) { 
       this. itera t or = iterator;     }

    @O v er r i de    pub lic boolean  has N ext( ) {    retu rn it er a to r .hasNext();
    }
   @Ove rride 
    public T  next() {     ret urni te r ator.next();
   }}

PlaneHe u risticFu nctio n.java:package c o m .stackex cha nge .co der e v ie w.graph.model . s uppo rt ;

impo rtcom.sta cke xch ang e.c od ereview.g raph.mod el .A bs tr act Heuri s ticFunct io n;im por t com . stacke xchan ge.c od er e vie w.graph . mo d e l.Ab st ra ctNo de; 
i mport  com . sta ckexcha nge.coder evi e w.gr ap h. model.P laneLayout;
i mp ort java.a wt .ge om.Poi n t 2D;

pub lic class PlaneHeuristi c Functio n<T  exte ndsAbstractN ode <T>> imp l ements  Abstr actHe ur ist i c Funct i o n< T>{
    priva t e  Ttarge t; 
   privat e PlaneLayout<T> l a you t;
    privat e P oint 2 D .D oub l et arg et L oca t i on;

    public  PlaneHeur is t ic Function(f i nal  P laneLay out<T>layou t ,
                          final T ta rget) {        t h is.la y ou t = l ayo ut;
     this .targe t Loc ation  = lay ou t.get( targe t) ;
    }
    @Override


 _ _}

   _@Override
 __ public_Double_put(final DirectedGraphNode node1,_
  _   _  __           final DirectedGraphNode node2,_
_ ___    _    _ _     final double weight)_{
_  _    if (!map.containsKey(node1)) {
  _     _  _map.put(node1,_new_HashMap<>());
   _    }

 _     _final Double old = map.get(node1).get(node2);
  _     map.get(node1).put(node2,_weight);
    _ _ return old;
  _ }

 _ _@Override
  _ public double get(final DirectedGraphNode node1,_
  _     __  ___ _  __ final_DirectedGraphNode_node2) {
    __  return map.get(node1).get(node2);
   _}
}

IteratorProxy.java:
package com.stackexchange.codereview.graph.model.support;

import java.util.Iterator;

public class_IteratorProxy<T>_implements Iterator<T> {

 _  private final Iterator<T>_iterator;

    protected IteratorProxy(final_Iterator<T> iterator)_{
 _      this.iterator = iterator;
  _ }

    @Override
_   public_boolean hasNext()_{
_  __ _ return iterator.hasNext();
    }

_ _ @Override
    public_T next() {
 __     return_iterator.next();
    }
}

PlaneHeuristicFunction.java:
package com.stackexchange.codereview.graph.model.support;

import_com.stackexchange.codereview.graph.model.AbstractHeuristicFunction;
import com.stackexchange.codereview.graph.model.AbstractNode;
import com.stackexchange.codereview.graph.model.PlaneLayout;
import java.awt.geom.Point2D;

public class_PlaneHeuristicFunction<T_extends_AbstractNode<T>> 
implements AbstractHeuristicFunction<T> {

 _  private T target;
 _  private_PlaneLayout<T> layout;
    private Point2D.Double_targetLocation;

_   public PlaneHeuristicFunction(final PlaneLayout<T>_layout,
_     ___    _     _        _  _  final T target)_{
__      this.layout = layout;
 _ _  _ this.targetLocation = layout.get(target);
    }

  _ @Override
