### Question:
AbstractConfigSource implements ConfigSource { @Override public final ConfigSource include(final Location location) throws IOException { if ((location == null) || location == ConfigSource.UNDEFINED_LOCATION) { throw new IllegalArgumentException("Unknown location"); } final IncludeVisitor visitor = new IncludeVisitor(location.toString()); visit(visitor); final ConfigSource configSource = visitor.getConfigSource(); if (configSource == null) { throw new IllegalStateException("Unsupported location type"); } return configSource; }  @Override final ConfigSource include(final Location location);  }### Answer:
@Test(expectedExceptions=IllegalArgumentException.class) public void testIncludeWithoutLocation() throws IOException { source.include(null); }
@Test(expectedExceptions=IllegalArgumentException.class) public void testIncludeWithDefaultLocation() throws IOException { source.include(ConfigSource.UNDEFINED_LOCATION); }
@Test public void testIncludeWithURLLocation() throws Exception { source.setLocation(new URLLocation(new URL("http: final ConfigSource included = source.include( new Location() { @Override public String toString() { return "/home/"; } }); assertNotNull(included); }
@Test(expectedExceptions=IllegalStateException.class) public void testIncludeWithUnsupportedLocation() throws Exception { mockLocation.accept(isA(IncludeVisitor.class)); expectLastCall(); source.setLocation(mockLocation); EasyMockUnitils.replay(); source.include( new Location() { @Override public String toString() { return "/home/"; } }); }