### Question:
TreeConfig { @JsonIgnore public double cacheWeight() { if (unevictable) { return 0; } else { return cacheWeight; } } TreeConfig(@JsonProperty("cacheWeight") double cacheWeight,
                      @JsonProperty("unevictable") boolean unevictable); @JsonIgnore double cacheWeight(); @Nonnull static TreeConfig readFromDataDirectory(Path dir); static void writeConfigToDataDirectory(Path dir, TreeConfig config); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString(); final double cacheWeight; final boolean unevictable; }### Answer:
@Test public void cacheWeight() throws Exception { TreeConfig config = Configs.decodeObject(TreeConfig.class, "unevictable = true"); assertEquals(0.0d, config.cacheWeight(), 0.001); config = Configs.decodeObject(TreeConfig.class, "unevictable = false, cacheWeight = 5"); assertNotEquals(0.0d, config.cacheWeight(), 0.001); }