PropertySource { @Nullable public String getHttpAgent() { return getSystemProperty("http.agent"); }  @Nullable String getHttpAgent(); @Nullable String getJVMVersion(); @Nullable String getSystemProperty(String key);  }
@Test public void testGetHttpAgent() { PropertySource propertySource = spy(new PropertySource()); propertySource.getHttpAgent(); verify(propertySource).getSystemProperty("http.agent"); assertEquals(propertySource.getHttpAgent(), propertySource.getSystemProperty("http.agent")); }