### Question:
SchemaBuilder { public static Schema renameFields(Schema original, Map<String,String> renames) { List<Field> fields = new ArrayList<>(); for (Field f : original) { if (renames.containsKey(f.name())) { f = new Field(renames.get(f.name()), f.type, f.crs, f.props); } fields.add(f); } return new Schema(original.name(), fields); } SchemaBuilder(String name); SchemaBuilder uri(String uri); SchemaBuilder crs(CoordinateReferenceSystem crs); SchemaBuilder crs(String srs); SchemaBuilder field(String name, Class<?> type); SchemaBuilder field(String name, Class<? extends Geometry> type, String crs); SchemaBuilder field(String name, Class<? extends Geometry> type, CoordinateReferenceSystem crs); SchemaBuilder field(Field fld); SchemaBuilder fields(Iterable<Field> flds); SchemaBuilder fields(String spec); SchemaBuilder fields(Feature f); SchemaBuilder property(String key, Object value); Schema schema(); static Schema select(Schema original, Iterable<String> fields); static Schema crs(Schema original, CoordinateReferenceSystem crs); static Schema rename(Schema original, String name); static Schema renameFields(Schema original, Map<String,String> renames);  }### Answer:
@Test public void testRenameFields() { Schema schema = new SchemaBuilder("widgets") .fields("sp:String,ip:Integer,pp:Point:srid=4326").schema(); Map<String,String> renames = new HashMap<>(); renames.put("sp", "ps"); renames.put("ip", "pi"); schema = SchemaBuilder.renameFields(schema, renames); assertNotNull(schema.field("ps")); assertNotNull(schema.field("pi")); assertNotNull(schema.field("pp")); assertNull(schema.field("sp")); assertNull(schema.field("ip")); }