### Question:
PointList implements Iterable<GHPoint3D>, PointAccess { public PointList shallowCopy(final int from, final int end, boolean makeImmutable) { if (makeImmutable) this.makeImmutable(); return new ShallowImmutablePointList(from, end, this); } PointList();  PointList(int cap, boolean is3D); @Override boolean is3D(); @Override int getDimension(); @Override void ensureNode(int nodeId); @Override void setNode(int nodeId, double lat, double lon); @Override void setNode(int nodeId, double lat, double lon, double ele); void set(int index, double lat, double lon, double ele); void add(double lat, double lon); void add(double lat, double lon, double ele); void add(PointAccess nodeAccess, int index); void add(GHPoint point); void add(PointList points); void removeLastPoint(); int size(); int getSize(); boolean isEmpty(); @Override double getLat(int index); @Override double getLatitude(int index); @Override double getLon(int index); @Override double getLongitude(int index); @Override double getElevation(int index); void setElevation(int index, double ele); @Override double getEle(int index); void reverse(); void clear(); void trimToSize(int newSize); @Override String toString(); static PointList fromLineString(LineString lineString); LineString toLineString(boolean includeElevation); LineString getCachedLineString(boolean includeElevation); @Override boolean equals(Object obj); static boolean equalsEps(double d1, double d2); static boolean equalsEps(double d1, double d2, double epsilon); PointList clone(boolean reverse); PointList copy(int from, int end); PointList shallowCopy(final int from, final int end, boolean makeImmutable); @Override int hashCode(); double calcDistance(DistanceCalc calc); void parse2DJSON(String str); GHPoint3D get(int index); @Override Iterator<GHPoint3D> iterator(); static PointList from(LineString lineString); boolean isImmutable(); PointList makeImmutable(); static final PointList EMPTY; }### Answer:
@Test public void testShallowCopy() { PointList pl1 = new PointList(100, true); for (int i = 0; i < 1000; i++) { pl1.add(i, i, 0); } PointList pl2 = pl1.shallowCopy(100, 600, false); assertEquals(500, pl2.size()); for (int i = 0; i < pl2.size(); i++) { assertEquals(pl1.getLat(i + 100), pl2.getLat(i), .01); } pl1.set(100, 0, 0, 0); assertEquals(0, pl2.getLat(0), .01); PointList pl3 = pl2.shallowCopy(0, 100, true); assertTrue(pl1.isImmutable()); assertEquals(100, pl3.size()); for (int i = 0; i < pl3.size(); i++) { assertEquals(pl2.getLon(i), pl3.getLon(i), .01); } PointList pl4 = pl1.shallowCopy(0, pl1.size(), false); assertTrue(pl1.equals(pl4)); PointList pl5 = pl1.shallowCopy(100, 600, false); assertTrue(pl2.equals(pl5)); }