@Test (expected = NoSuchElementException.class) public void givenATestDexPathWhichConcatenatesThreePaths_whenNextDexPathString_thenThrowsAfterThirdInvocation() { testDexPathStringProcessor = new DexPathStringProcessor(TEST_COMPOSITE_DEX_PATH); testDexPathStringProcessor.nextDexPathString(); testDexPathStringProcessor.nextDexPathString(); testDexPathStringProcessor.nextDexPathString(); testDexPathStringProcessor.nextDexPathString(); }
public String nextDexPathString() throws NoSuchElementException { String nextDexPathString = extractedSingleDexPathStringsIterator.next(); if (nextDexPathString.startsWith(HTTP_PROTOCOL_STRING_WITHOUT_COLON)) { return nextDexPathString.replaceFirst( HTTP_PROTOCOL_STRING_WITHOUT_COLON, HTTP_PROTOCOL_STRING); } if (nextDexPathString.startsWith(HTTPS_PROTOCOL_STRING_WITHOUT_COLON)) { return nextDexPathString.replaceFirst( HTTPS_PROTOCOL_STRING_WITHOUT_COLON, HTTPS_PROTOCOL_STRING); } return nextDexPathString; }
DexPathStringProcessor { public String nextDexPathString() throws NoSuchElementException { String nextDexPathString = extractedSingleDexPathStringsIterator.next(); if (nextDexPathString.startsWith(HTTP_PROTOCOL_STRING_WITHOUT_COLON)) { return nextDexPathString.replaceFirst( HTTP_PROTOCOL_STRING_WITHOUT_COLON, HTTP_PROTOCOL_STRING); } if (nextDexPathString.startsWith(HTTPS_PROTOCOL_STRING_WITHOUT_COLON)) { return nextDexPathString.replaceFirst( HTTPS_PROTOCOL_STRING_WITHOUT_COLON, HTTPS_PROTOCOL_STRING); } return nextDexPathString; } }
DexPathStringProcessor { public String nextDexPathString() throws NoSuchElementException { String nextDexPathString = extractedSingleDexPathStringsIterator.next(); if (nextDexPathString.startsWith(HTTP_PROTOCOL_STRING_WITHOUT_COLON)) { return nextDexPathString.replaceFirst( HTTP_PROTOCOL_STRING_WITHOUT_COLON, HTTP_PROTOCOL_STRING); } if (nextDexPathString.startsWith(HTTPS_PROTOCOL_STRING_WITHOUT_COLON)) { return nextDexPathString.replaceFirst( HTTPS_PROTOCOL_STRING_WITHOUT_COLON, HTTPS_PROTOCOL_STRING); } return nextDexPathString; } DexPathStringProcessor(@NonNull String fullDexPathString); }
DexPathStringProcessor { public String nextDexPathString() throws NoSuchElementException { String nextDexPathString = extractedSingleDexPathStringsIterator.next(); if (nextDexPathString.startsWith(HTTP_PROTOCOL_STRING_WITHOUT_COLON)) { return nextDexPathString.replaceFirst( HTTP_PROTOCOL_STRING_WITHOUT_COLON, HTTP_PROTOCOL_STRING); } if (nextDexPathString.startsWith(HTTPS_PROTOCOL_STRING_WITHOUT_COLON)) { return nextDexPathString.replaceFirst( HTTPS_PROTOCOL_STRING_WITHOUT_COLON, HTTPS_PROTOCOL_STRING); } return nextDexPathString; } DexPathStringProcessor(@NonNull String fullDexPathString); boolean hasNextDexPathString(); String nextDexPathString(); }
DexPathStringProcessor { public String nextDexPathString() throws NoSuchElementException { String nextDexPathString = extractedSingleDexPathStringsIterator.next(); if (nextDexPathString.startsWith(HTTP_PROTOCOL_STRING_WITHOUT_COLON)) { return nextDexPathString.replaceFirst( HTTP_PROTOCOL_STRING_WITHOUT_COLON, HTTP_PROTOCOL_STRING); } if (nextDexPathString.startsWith(HTTPS_PROTOCOL_STRING_WITHOUT_COLON)) { return nextDexPathString.replaceFirst( HTTPS_PROTOCOL_STRING_WITHOUT_COLON, HTTPS_PROTOCOL_STRING); } return nextDexPathString; } DexPathStringProcessor(@NonNull String fullDexPathString); boolean hasNextDexPathString(); String nextDexPathString();  }