Sdk (@NotNull Sdk sdk, Consumer<? super SdkModificator> modifier) { Sdk clone; try { clone = (Sdk)sdk.clone(); } catch (CloneNotSupportedException e) { throw new RuntimeException(e); } SdkModificator sdkModificator = clone.getSdkModificator(); modifier.accept(sdkModificator); sdkModificator.commitChanges(); return clone; }