parseResources and parseMethods appear to have essentially identical code that only differs in what is returned. For clarity and to reduce duplication, consider combining the two.
One idea is to pass in a lambda to a common function that can be used to call resources.put or methods.addAll; the latter can be the default if no lambda is provided, since it is the recursive case.
parseResources
andparseMethods
appear to have essentially identical code that only differs in what is returned. For clarity and to reduce duplication, consider combining the two.One idea is to pass in a lambda to a common function that can be used to call
resources.put
ormethods.addAll
; the latter can be the default if no lambda is provided, since it is the recursive case.