JsonChatDeserializer extends JsonDeserializer<T> { protected boolean getAsBooleanOrFalse(JsonNode node) { if (node == null) { return false; } else { return node.asBoolean(); } }    }
@Test public void testGetAsBooleanOrNull() { assertFalse(underTest.getAsBooleanOrFalse(null)); JsonNode mockNode = mock(JsonNode.class); when(mockNode.asBoolean()).thenReturn(true); assertTrue(underTest.getAsBooleanOrFalse(mockNode)); }