### Question:
RevFeatureBuilder { public RevFeature build() { if (id == null) { id = HashObjectFunnels.hashFeature(values); } return RevObjectFactory.defaultInstance().createFeature(id, values); } RevFeatureBuilder(); RevFeature build(); RevFeatureBuilder reset(); RevFeatureBuilder addValue(@Nullable Object value); RevFeatureBuilder addValueNoCopy(@Nullable Object value); RevFeatureBuilder addAll(@NonNull List<Object> values); RevFeatureBuilder addAll(@NonNull Object... values); RevFeature build(@NonNull Feature feature);  }### Answer:
@Test public void testNullFeature() throws Exception { try { RevFeature.builder().build((Feature) null); fail("expected NullPointerException on null feature"); } catch (NullPointerException e) { assertTrue(e.getMessage(), e.getMessage().contains("feature is marked non-null but is null")); } }
@Test public void testBuildEmpty() throws Exception { RevFeature emptyFeature = RevFeature.builder().build(); assertNotNull(emptyFeature); assertTrue(emptyFeature.getValues().isEmpty()); assertEquals(ObjectId.valueOf("0aaf76f425c6e0f43a36197de768e67d9e035abb"), emptyFeature.getId()); }
@Test public void testBuildWithAddProperty() throws Exception { Feature f = points1; RevFeature feature = RevFeature.builder().build(f); RevFeatureBuilder b = RevFeature.builder(); f.forEach(b::addValue); RevFeature built = b.build(); assertEquals(feature, built); for (int i = 0; i < f.getAttributeCount(); i++) { assertEquals(f.getAttribute(i), built.getValues().get(i).orElse(null)); } }