@Test
public void testTrim() throws KlvDecodingException {

  geoBoxHandler.accept(KlvUtilities.createTestFloat(LAT1, 1));
  geoBoxHandler.accept(KlvUtilities.createTestFloat(LON1, 2));
  geoBoxHandler.accept(KlvUtilities.createTestFloat(LAT2, 3));
  geoBoxHandler.accept(KlvUtilities.createTestFloat(LON2, 4));
  geoBoxHandler.accept(KlvUtilities.createTestFloat(LAT3, 5));
  geoBoxHandler.accept(KlvUtilities.createTestFloat(LON3, 6));
  geoBoxHandler.accept(KlvUtilities.createTestFloat(LAT4, 7));
  geoBoxHandler.accept(KlvUtilities.createTestFloat(LON4, 8));
  // these are the values that should get trimmed
  geoBoxHandler.accept(KlvUtilities.createTestFloat(LAT1, 9));
  geoBoxHandler.accept(KlvUtilities.createTestFloat(LON1, 10));
  geoBoxHandler.accept(KlvUtilities.createTestFloat(LAT2, 11));
  geoBoxHandler.accept(KlvUtilities.createTestFloat(LON2, 12));
  geoBoxHandler.trim();
  Map<String, List<Double>> data = geoBoxHandler.getRawGeoData();
  assertThat(data.get(LAT1), hasSize(1));
  assertThat(data.get(LON1), hasSize(1));
  assertThat(data.get(LAT2), hasSize(1));
  assertThat(data.get(LON2), hasSize(1));
  assertThat(data.get(LAT3), hasSize(1));
  assertThat(data.get(LON3), hasSize(1));
  assertThat(data.get(LAT4), hasSize(1));
  assertThat(data.get(LON4), hasSize(1));
  assertThat(data.get(LAT1).get(0), is(closeTo(1, EPSILON)));
  assertThat(data.get(LON1).get(0), is(closeTo(2, EPSILON)));
  assertThat(data.get(LAT2).get(0), is(closeTo(3, EPSILON)));
  assertThat(data.get(LON2).get(0), is(closeTo(4, EPSILON)));
  assertThat(data.get(LAT3).get(0), is(closeTo(5, EPSILON)));
  assertThat(data.get(LON3).get(0), is(closeTo(6, EPSILON)));
  assertThat(data.get(LAT4).get(0), is(closeTo(7, EPSILON)));
  assertThat(data.get(LON4).get(0), is(closeTo(8, EPSILON)));
}