added apache licence header, fixed NPE bug and changed multiplicity enum name
added small first test