### Question:
Shapefile { public static void createPolygon(List<Coordinate> coords, File output) { ShapefileCreator.createPolygon(coords, output); } private  Shapefile(File file, double bufferDistance); static Shapefile from(File file); static Shapefile from(File file, double bufferDistance); static void createPolygon(List<Coordinate> coords, File output); static Shapefile fromZip(InputStream is); static DataStore fromZipAsDataStore(InputStream is); static Shapefile fromZip(InputStream is, double bufferDistance); List<PreparedGeometry> geometries(); boolean contains(double lat, double lon); Rect mbr(); void close(); void writeGeoJson(Writer writer, String targetCrsName);  }### Answer:
@Test public void testCreatePolygonShapefile() throws IOException { try (InputStreamReader r = new InputStreamReader( Shapefile.class.getResourceAsStream("/southwest.txt"))) { List<Coordinate> coords = Strings.lines(r).map(line -> line.trim()) .filter(line -> line.length() > 0).filter(line -> line.charAt(0) != '#') .doOnNext(System.out::println).map(line -> line.split(" ")) .map(items -> new Coordinate(parseDouble(items[0]), parseDouble(items[1]))) .toList().map(list -> { List<Coordinate> list2 = Lists.newArrayList(list); list2.add(new Coordinate(list.get(0).x, list.get(0).y)); return list2; }).toBlocking().single(); ShapefileCreator.createPolygon(coords, new File("target/southwest.shp")); } }