@Test
public void testDistance() throws Exception {

    LineString ls = gf.createLineString(csf.create(new double[] {0,0,1,1,2,2,3,3,4,4,5,5}));
    
    Decimator d = new Decimator(identity, new Rectangle(0,0,5,5), 0.8);
    d.decimateTransformGeneralize((Geometry) ls.clone(), identity);
    assertEquals(6, ls.getNumPoints());
    
    d = new Decimator(identity, new Rectangle(0,0,5,5), 1);
    d.decimateTransformGeneralize(ls, identity);
    assertEquals(4, ls.getNumPoints());
    
    d = new Decimator(identity, new Rectangle(0,0,5,5), 6);
    d.decimateTransformGeneralize(ls, identity);
    assertEquals(2, ls.getNumPoints());
}