in src/main/java/org/apache/sling/testing/resourceresolver/MockResource.java [111:125]
public <AdapterType> AdapterType adaptTo(final Class<AdapterType> type) {
if ( type == ValueMap.class || type == Map.class ) {
return (AdapterType)new ReadonlyValueMapDecorator(this.props);
}
else if ( type == ModifiableValueMap.class ) {
return (AdapterType)this.props;
}
else if ( type == InputStream.class ) {
InputStream is = getFileResourceInputStream();
if (is != null) {
return (AdapterType)is;
}
}
return super.adaptTo(type);
}