Using NotNull Annotation in method argument

@Nullable and @NotNull do nothing on their own. They are supposed to act as Documentation tools. The @Nullable Annotation reminds you about the necessity to introduce an NPE check when: Calling methods that can return null. Dereferencing variables (fields, local variables, parameters) that can be null. The @NotNull Annotation is, actually, an explicit contract declaring the following: A method should not return … Read more

Move existing, uncommitted work to a new branch in Git

Update 2020 / Git 2.23 Git 2.23 adds the new switch subcommand in an attempt to clear some of the confusion that comes from the overloaded usage of checkout (switching branches, restoring files, detaching HEAD, etc.) Starting with this version of Git, replace the checkout command with: The behavior is identical and remains unchanged. Before Update 2020 / Git … Read more

What is the difference between pull and clone in git?

They’re basically the same, except clone will setup additional remote tracking branches, not just master. Check out the man page: Clones a repository into a newly created directory, creates remote-tracking branches for each branch in the cloned repository (visible using git branch -r), and creates and checks out an initial branch that is forked from the … Read more

Pass Method as Parameter using C#

You can use the Func delegate in .net 3.5 as the parameter in your RunTheMethod method. The Func delegate allows you to specify a method that takes a number of parameters of a specific type and returns a single argument of a specific type. Here is an example that should work: