NodeMapper { @SuppressWarnings("unchecked") public <T extends Collection, U, V extends Collection<? extends U>> V deserializeCollection( Node value, Class<T> into, Class<U> members ) { return (V) deserializeNext(value, "", into, members, this); }  void setSerializeNullValues(boolean serializeNullValues); boolean getSerializeNullValues(); void setWhenMissingSetter(WhenMissing whenMissing); WhenMissing getWhenMissingSetter(); void disableToNodeForClass(Class type); void enableToNodeForClass(Class type); Set<Class> getDisableToNode(); void disableFromNodeForClass(Class type); void enableFromNodeForClass(Class type); Set<Class> getDisableFromNode(); boolean getOmitEmptyValues(); void setOmitEmptyValues(boolean omitEmptyValues); Node serialize(Object object); T deserialize(Node value, Class<T> into); T deserializeInto(Node value, T objectToMutate); @SuppressWarnings("unchecked") V deserializeCollection(
            Node value,
            Class<T> into,
            Class<U> members
    ); @SuppressWarnings("unchecked") V deserializeMap(
            Node value, Class<T> into,
            Class<U> members
    );  }
@Test public void deserializesListWithSpecificMember() { Node value = Node.parse("[true, false, true]"); assertThat(new NodeMapper().deserializeCollection(value, List.class, Boolean.class), contains(true, false, true)); }
@Test public void deserializesSets() { Node value = Node.fromStrings("a", "b"); NodeMapper mapper = new NodeMapper(); Set<String> result = mapper.deserializeCollection(value, Set.class, String.class); assertThat(result, instanceOf(HashSet.class)); assertThat(result, contains("a", "b")); }
@Test public void deserializesHashSets() { Node value = Node.fromStrings("a", "b"); NodeMapper mapper = new NodeMapper(); Set<String> result = mapper.deserializeCollection(value, HashSet.class, String.class); assertThat(result, instanceOf(HashSet.class)); assertThat(result, contains("a", "b")); }
@Test public void deserializesLinkedHashSets() { Node value = Node.fromStrings("a", "b"); NodeMapper mapper = new NodeMapper(); Set<String> result = mapper.deserializeCollection(value, LinkedHashSet.class, String.class); assertThat(result, instanceOf(LinkedHashSet.class)); assertThat(result, contains("a", "b")); }
@Test public void deserializesList() { Node value = Node.fromStrings("a", "b"); NodeMapper mapper = new NodeMapper(); List<String> result = mapper.deserializeCollection(value, List.class, String.class); assertThat(result, instanceOf(ArrayList.class)); assertThat(result, contains("a", "b")); }
@Test public void deserializesArrayList() { Node value = Node.fromStrings("a", "b"); NodeMapper mapper = new NodeMapper(); List<String> result = mapper.deserializeCollection(value, ArrayList.class, String.class); assertThat(result, instanceOf(ArrayList.class)); assertThat(result, contains("a", "b")); }