### Question:
XthPrimeAlgorithm extends AlgorithmLevelImpl { @Override public String get(int i) { if (i == 0) { return "1"; } if (i <= primes.size()) { return String.valueOf(primes.get(i - 1)); } int index = 1; int num = 1; if (primes.size() > 0) { index = primes.size() + 1; num = primes.peekLast(); } while (true) { num++; boolean cont = false; for (int j = 0; j < index - 1; j++) { if (num % primes.get(j) == 0) { cont = true; break; } } if (cont) { continue; } if (!new String(new char[num]).matches(".?|(..+?)\\1+")) { if (primes.size() < index) { primes.add(num); } if (i == index) { return String.valueOf(num); } index++; } } }  @Override String get(int i); @Override String description(); @Override String author(); @Override int complexity(); static LinkedList<Integer> primes; }### Answer:
@Test public void shouldWorkWithCache() { assertEquals("17", algorithm.get("7")); Assertions.assertAlgorithm(PRIMES, algorithm); }