1616package com .developerb .nmxmlp ;
1717
1818import com .google .common .base .Joiner ;
19- import com .google .common .collect .Lists ;
20- import com .google .common .collect .Maps ;
21- import com .google .common .collect .Sets ;
2219import com .google .common .io .ByteSource ;
2320import org .w3c .dom .Document ;
2421import org .w3c .dom .DocumentType ;
4542import java .nio .charset .Charset ;
4643import java .util .ArrayList ;
4744import java .util .Collections ;
45+ import java .util .HashMap ;
4846import java .util .List ;
4947import java .util .Map ;
5048import java .util .Optional ;
5149import java .util .Set ;
50+ import java .util .TreeSet ;
5251import java .util .function .Function ;
5352import java .util .function .Predicate ;
5453
@@ -64,7 +63,7 @@ public class NX {
6463
6564 private final DocumentBuilderFactory docBuilderFactory ;
6665 private final TransformerFactory transformerFactory ;
67- private final Map <Class <?>, Extractor <?>> extractors = Maps . newHashMap ();
66+ private final Map <Class <?>, Extractor <?>> extractors = new HashMap <> ();
6867
6968 public NX () {
7069 this (Collections .emptySet ());
@@ -414,12 +413,12 @@ public <R> R extract(Class<R> type) throws Ex {
414413
415414 @ Override
416415 public <R > List <R > extractCollection (String needle , Class <R > type ) throws Ex {
417- return Lists . newArrayList ();
416+ return new ArrayList <> ();
418417 }
419418
420419 @ Override
421420 public <R > List <R > extractCollection (String needle , Extractor <R > extractor ) throws Ex {
422- return Lists . newArrayList ();
421+ return new ArrayList <> ();
423422 }
424423
425424 @ Override
@@ -560,7 +559,7 @@ public Cursor append(String tagName) throws Ex {
560559 Element element = document .createElement (tagName );
561560 Node newNode = node .appendChild (element );
562561
563- List <NodeCursor > ancestors = Lists . newArrayList (this .ancestors );
562+ List <NodeCursor > ancestors = new ArrayList <> (this .ancestors );
564563 ancestors .add (this );
565564
566565 return new NodeCursor (document , ancestors , newNode , 0 );
@@ -577,7 +576,7 @@ public Cursor appendAfter(String tagName, Predicate<Cursor> predicate) throws Ex
577576 Node nextSibling = match .node .getNextSibling ();
578577 node .insertBefore (element , nextSibling );
579578
580- List <NodeCursor > ancestors = Lists . newArrayList (this .ancestors );
579+ List <NodeCursor > ancestors = new ArrayList <> (this .ancestors );
581580 ancestors .add (this );
582581
583582 return new NodeCursor (document , ancestors , element , 0 );
@@ -661,7 +660,7 @@ public Cursor to(int position, String tagName) throws MissingNode {
661660 }
662661
663662 private List <NodeCursor > newAncestorList () {
664- final List <NodeCursor > newAncestorList = Lists . newArrayList (ancestors );
663+ final List <NodeCursor > newAncestorList = new ArrayList <> (ancestors );
665664 newAncestorList .add (this );
666665
667666 return newAncestorList ;
@@ -718,7 +717,7 @@ public <R> R extract(Extractor<R> extractor) throws Ex {
718717
719718 @ Override
720719 public <R > List <R > extractCollection (String needle , final Extractor <R > extractor ) throws Ex {
721- final List <R > result = Lists . newArrayList ();
720+ final List <R > result = new ArrayList <> ();
722721
723722 iterateCollection (needle , cursor -> {
724723 final R converted = cursor .extract (extractor );
@@ -983,7 +982,7 @@ public static class MissingNode extends Ex {
983982 }
984983
985984 private static String summarize (NodeList childNodes ) {
986- final Set <String > names = Sets . newTreeSet ();
985+ final Set <String > names = new TreeSet <> ();
987986 for (int i = 0 ; i < childNodes .getLength (); i ++) {
988987 final Node item = childNodes .item (i );
989988 String name = item .getLocalName ();
0 commit comments