### Question:
PathResolver implements Resolver { @Override public String resolve() { String location = null; for (String path : systemProperties.getPath()) { location = resolve(path); if (location != null) { break; } } return location; } PathResolver(SystemProperties systemProperties,
                      String versionSpec); @Override String resolve();  }### Answer:
@Test public void testShouldNotResolve() { when(systemProperties.getPath()).thenReturn(Collections.singletonList("/tmp")); assertThat(getResolver(VERSION).resolve()).isNull(); }
@Test public void testShouldResolveBin() { when(systemProperties.getPath()).thenReturn(Collections.singletonList(phantomJsBinary.get().getParent())); assertThat(getResolver(VERSION).resolve()).isEqualTo(phantomJsBinary.get().getAbsolutePath()); }
@Test public void testShouldResolveBinWrongVersion() { when(systemProperties.getPath()).thenReturn(Collections.singletonList(phantomJsBinary.get().getParent())); assertThat(getResolver("1.9.2").resolve()).isNull(); }