mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-01-04 00:20:55 +07:00
27 lines
555 B
Java
27 lines
555 B
Java
public class TwoArraysDiff {
|
|
public void test(Iterable<String> net) {
|
|
final int size = 3;
|
|
final double[] d1 = new double[size];
|
|
int count = 0;
|
|
for (String s : net) {
|
|
d1[count++] = calculate();
|
|
}
|
|
final double[] d2 = new double[size];
|
|
count = 0;
|
|
for (String s : net) {
|
|
d2[count++] = calculate();
|
|
}
|
|
for (int i = 0; i < size; i++) {
|
|
assertTrue(d2[i] < d1[i]);
|
|
}
|
|
}
|
|
|
|
static void assertTrue(boolean b) {
|
|
if (!b) {
|
|
throw new AssertionError();
|
|
}
|
|
}
|
|
|
|
native double calculate();
|
|
}
|