### Question:
RmlMapper { public Model map(Set<TriplesMap> mapping) { validateMapping(mapping); Model model = new LinkedHashModel(); Set<TriplesMap> functionValueTriplesMaps = getTermMaps(mapping) .filter(t -> t.getFunctionValue() != null) .map(TermMap::getFunctionValue) .collect(ImmutableCollectors.toImmutableSet()); if(LOG.isWarnEnabled()) { boolean deprecatedFno = functionValueTriplesMaps.stream() .flatMap(triplesMap -> triplesMap.getPredicateObjectMaps().stream()) .flatMap(pom -> pom.getPredicateMaps().stream()) .anyMatch(predicateMap -> predicateMap.getConstant().equals(Rdf.Fno.old_executes)); if (deprecatedFno) { LOG.warn("Usage of deprecated predicate <{}> encountered. Support in next release is not guaranteed. Upgrade to <{}>.", Rdf.Fno.old_executes, Rdf.Fno.executes); } } Set<TriplesMap> refObjectTriplesMaps = getAllTriplesMapsUsedInRefObjectMap(mapping); mapping.stream() .filter(m -> !functionValueTriplesMaps.contains(m) || refObjectTriplesMaps.contains(m)) .forEach(m -> map(m, model)); this.sourceManager.clear(); return model; } private  RmlMapper(
		Function<Object, String> sourceResolver,
		Map<IRI, LogicalSourceResolver<?>> logicalSourceResolvers,
		Functions functions,
		Form normalizationForm,
		boolean iriUpperCasePercentEncoding
	); static Builder newBuilder(); Form getNormalizationForm(); boolean getIriUpperCasePercentEncoding(); LogicalSourceManager getSourceManager(); Optional<ExecuteFunction> getFunction(IRI iri); Model map(Set<TriplesMap> mapping); void bindInputStream(InputStream inputStream); void bindInputStream(String name, InputStream inputStream);  }### Answer:
@Test public void mapper_notFindingBoundUnnamedInputStream_shouldThrowException() { RmlMappingLoader loader = RmlMappingLoader.build(); InputStream input = RmlMapperTest.class.getResourceAsStream("simple.carml.rml.ttl"); RuntimeException exception = assertThrows(RuntimeException.class, () -> mapper.map(loader.load(RDFFormat.TURTLE, input))); assertThat(exception.getMessage(), is("attempting to get source, but no binding was present")); }
@Test public void mapper_notFindingBoundNamedInputStreams_shouldThrowException() { String streamName = "foo"; RmlMappingLoader loader = RmlMappingLoader.build(); InputStream input = RmlMapperTest.class.getResourceAsStream("simple.namedcarml.rml.ttl"); RuntimeException exception = assertThrows(RuntimeException.class, () -> mapper.map(loader.load(RDFFormat.TURTLE, input))); assertThat(exception.getMessage(), is(String.format("attempting to get source by " + "name [%s], but no such binding is present", streamName))); }
@Test public void mapper_withNoBoundSource_shouldThrowException() throws IOException { RmlMappingLoader loader = RmlMappingLoader.build(); InputStream input = RmlMapperTest.class.getResourceAsStream("simple.carml.rml.ttl"); RuntimeException exception = assertThrows(RuntimeException.class, () -> mapper.map(loader.load(RDFFormat.TURTLE, input))); assertThat(exception.getMessage(), is("attempting to get source, but no binding was present")); }