23
23
*/
24
24
package org .openscience .cdk .graph ;
25
25
26
- import com .google .common .collect .Lists ;
27
26
import org .junit .Test ;
28
27
29
28
import java .io .IOException ;
29
+ import java .util .ArrayList ;
30
30
import java .util .Iterator ;
31
31
import java .util .List ;
32
32
33
33
import static org .hamcrest .CoreMatchers .hasItem ;
34
34
import static org .hamcrest .CoreMatchers .hasItems ;
35
35
import static org .hamcrest .CoreMatchers .is ;
36
36
import static org .hamcrest .CoreMatchers .sameInstance ;
37
- import static org .junit .Assert .assertFalse ;
38
37
import static org .hamcrest .MatcherAssert .assertThat ;
38
+ import static org .junit .Assert .assertFalse ;
39
39
import static org .junit .Assert .assertTrue ;
40
40
41
41
/**
@@ -137,7 +137,7 @@ public void lengths_naphthalene() throws IOException {
137
137
@ Test
138
138
public void cycles_naphthalene () throws IOException {
139
139
InitialCycles initial = new InitialCycles (naphthalene ());
140
- List <InitialCycles .Cycle > cycles = Lists . newArrayList (initial .cycles ());
140
+ List <InitialCycles .Cycle > cycles = new ArrayList <> (initial .cycles ());
141
141
assertThat (cycles .size (), is (2 ));
142
142
assertThat (cycles .get (0 ).path (), is (new int []{5 , 0 , 1 , 2 , 3 , 4 , 5 }));
143
143
assertThat (cycles .get (1 ).path (), is (new int []{5 , 4 , 7 , 8 , 9 , 6 , 5 }));
@@ -151,7 +151,7 @@ public void lengths_anthracene() throws IOException {
151
151
@ Test
152
152
public void cycles_anthracene () throws IOException {
153
153
InitialCycles initial = new InitialCycles (anthracene ());
154
- List <InitialCycles .Cycle > cycles = Lists . newArrayList (initial .cycles ());
154
+ List <InitialCycles .Cycle > cycles = new ArrayList <> (initial .cycles ());
155
155
assertThat (cycles .size (), is (3 ));
156
156
assertThat (cycles .get (0 ).path (), is (new int []{5 , 0 , 1 , 2 , 3 , 4 , 5 }));
157
157
assertThat (cycles .get (1 ).path (), is (new int []{9 , 6 , 5 , 4 , 7 , 8 , 9 }));
@@ -166,7 +166,7 @@ public void lengths_bicyclo() throws IOException {
166
166
@ Test
167
167
public void cycles_bicyclo () throws IOException {
168
168
InitialCycles initial = new InitialCycles (bicyclo ());
169
- List <InitialCycles .Cycle > cycles = Lists . newArrayList (initial .cycles ());
169
+ List <InitialCycles .Cycle > cycles = new ArrayList <> (initial .cycles ());
170
170
assertThat (cycles .size (), is (3 ));
171
171
assertThat (cycles .get (0 ).path (), is (new int []{5 , 0 , 1 , 2 , 3 , 4 , 5 }));
172
172
assertThat (cycles .get (1 ).path (), is (new int []{5 , 0 , 1 , 2 , 7 , 6 , 5 }));
@@ -186,7 +186,7 @@ public void lengths_cyclophane() throws IOException {
186
186
@ Test
187
187
public void cycles_cyclophane () throws IOException {
188
188
InitialCycles initial = new InitialCycles (cyclophane_odd ());
189
- List <InitialCycles .Cycle > cycles = Lists . newArrayList (initial .cycles ());
189
+ List <InitialCycles .Cycle > cycles = new ArrayList <> (initial .cycles ());
190
190
assertThat (cycles .size (), is (2 ));
191
191
assertThat (cycles .get (0 ).path (), is (new int []{3 , 2 , 1 , 0 , 5 , 4 , 3 }));
192
192
assertThat (cycles .get (1 ).path (), is (new int []{3 , 2 , 1 , 0 , 10 , 9 , 8 , 7 , 6 , 3 }));
@@ -195,30 +195,30 @@ public void cycles_cyclophane() throws IOException {
195
195
@ Test
196
196
public void cycles_cyclophane_odd_limit_5 () throws IOException {
197
197
InitialCycles initial = new InitialCycles (cyclophane_odd (), 5 );
198
- List <InitialCycles .Cycle > cycles = Lists . newArrayList (initial .cycles ());
198
+ List <InitialCycles .Cycle > cycles = new ArrayList <> (initial .cycles ());
199
199
assertThat (cycles .size (), is (0 ));
200
200
}
201
201
202
202
@ Test
203
203
public void cycles_cyclophane_odd_limit_6 () throws IOException {
204
204
InitialCycles initial = new InitialCycles (cyclophane_odd (), 6 );
205
- List <InitialCycles .Cycle > cycles = Lists . newArrayList (initial .cycles ());
205
+ List <InitialCycles .Cycle > cycles = new ArrayList <> (initial .cycles ());
206
206
assertThat (cycles .size (), is (1 ));
207
207
assertThat (cycles .get (0 ).path (), is (new int []{3 , 2 , 1 , 0 , 5 , 4 , 3 }));
208
208
}
209
209
210
210
@ Test
211
211
public void cycles_cyclophane_odd_limit_7 () throws IOException {
212
212
InitialCycles initial = new InitialCycles (cyclophane_odd (), 7 );
213
- List <InitialCycles .Cycle > cycles = Lists . newArrayList (initial .cycles ());
213
+ List <InitialCycles .Cycle > cycles = new ArrayList <> (initial .cycles ());
214
214
assertThat (cycles .size (), is (1 ));
215
215
assertThat (cycles .get (0 ).path (), is (new int []{3 , 2 , 1 , 0 , 5 , 4 , 3 }));
216
216
}
217
217
218
218
@ Test
219
219
public void cycles_family_odd () {
220
220
InitialCycles initial = new InitialCycles (cyclophane_odd ());
221
- List <InitialCycles .Cycle > cycles = Lists . newArrayList (initial .cycles ());
221
+ List <InitialCycles .Cycle > cycles = new ArrayList <> (initial .cycles ());
222
222
assertThat (cycles .get (1 ).path (), is (new int []{3 , 2 , 1 , 0 , 10 , 9 , 8 , 7 , 6 , 3 }));
223
223
int [][] family = cycles .get (1 ).family ();
224
224
assertThat (family .length , is (2 ));
@@ -229,7 +229,7 @@ public void cycles_family_odd() {
229
229
@ Test
230
230
public void cycles_family_even () {
231
231
InitialCycles initial = new InitialCycles (cyclophane_even ());
232
- List <InitialCycles .Cycle > cycles = Lists . newArrayList (initial .cycles ());
232
+ List <InitialCycles .Cycle > cycles = new ArrayList <> (initial .cycles ());
233
233
assertThat (cycles .get (1 ).path (), is (new int []{3 , 6 , 7 , 8 , 9 , 10 , 11 , 0 , 1 , 2 , 3 }));
234
234
int [][] family = cycles .get (1 ).family ();
235
235
assertThat (family .length , is (2 ));
0 commit comments